bitfields 2.0.6

Macro for for generating bitfields from structs and enum bitflags for defining packed binary schemas in low-level systems (e.g. embedded development or emulators)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use bitfields::bitfield;

#[bitfield(u64, new = false)]
pub struct Bitfield {
    #[bits(4, default = 0x1)]
    a: u8,
    #[bits(60, default = 0xFFFF_FFFF_FFFF)]
    _reserved: u64
}

fn main() {
    let bitfield = Bitfield::new(0);
}