< 返回版块

Mike Tang 发表于 2019-11-07 11:33

一个使用 Rust 类型编程实现更安全编程的完美例子,可仔细阅读。

Using Type-Level Programming in Rust to Make Safer Hardware Abstractions

n the world of systems programming where one may find themselves writing hardware drivers or interacting directly with memory-mapped devices, that interaction is almost always through memory-mapped registers provided by the hardware. We typically interact with these things through bitwise operations on some fixed-width numeric type.

For instance, imagine an 8-bit register with three fields:

https://blog.auxon.io/2019/10/25/type-level-registers/


Ext Link: https://blog.auxon.io/2019/10/25/type-level-registers/

评论区

写评论

还没有评论

1 共 0 条评论, 1 页