Crate bitbybit

source ·

Attribute Macros

  • Defines a bitenum: #[bitenum(<base-data-type>, exhaustive: true)] is a data type like u2 (arbitrary_int::u2) or u8 which is used the actually store the value of the bitfield. exhaustive specifies whether the bitenum includes all possible value of the given base data type (for example, a bitenum over u2 with 4 values is exhaustive)
  • Defines a bitfield: #[bitfield(, default: 0)] is a data type like u32 which is used to represent all the bits of the bitfield. default is an optional default when the bitfield is created