Efficient implementation of bit-fields where several numbers are packed within a larger number and bit-enums. Useful for drivers, so it works in no_std environments
usebitbybit::bitfield;// No issues with the private internal field value when a field is named value.
#[bitfield(u32, default = 0x0, debug)]pubstructData{#[bit(15, rw)]dparity:bool,
#[bits(0..=7, rw)]value:u8,
}pubfnmain(){}