simple_bitfield
- yet another bitfield implementation for Rust
Easily create C-style bitfields that have the same size as the underlying type and are Copy + Clone
(requires the underlying type to be Copy + Clone
as well):
use ;
bitfield!
Syntax
Like in C:
(pub) struct BitfieldName<BaseType> {
field_name: field_size,
_: size_to_skip
}
Documentation
On docs.rs: https://docs.rs/simple_bitfield
Credits
Initial idea was adapted from https://guiand.xyz/blog-posts/bitfields.html.