pub struct BitField {
pub width: u32,
pub bit_offset: u64,
pub signed: bool,
pub storage: String,
pub storage_offset: u64,
pub getter: String,
pub setter: String,
}Expand description
What makes a member a bit-field (C99 6.7.2.1).
A bit-field has no address of its own, so it is not a Rust field: a maximal
run of them shares one [u8; K] storage field, and reading or writing one
goes through a pair of generated accessors. Everything code generation needs
to emit those — where the bits are and how wide they are — lives here.
Fields§
§width: u32The declared width, in bits.
bit_offset: u64The bit offset from the start of the record, counting from the least significant bit of byte 0 (the little-endian bit order every ABI this crate targets uses).
signed: boolWhether reading the field sign-extends.
Usually the signedness of the declared type; an enum bit-field follows
the enumeration’s underlying type instead, which GCC and Clang make
unsigned when no enumerator is negative.
storage: StringThe name of the [u8; K] field the bits live in.
storage_offset: u64The byte offset of that field within the record.
getter: StringThe name of the generated getter.
setter: StringThe name of the generated setter.