Skip to main content

bitfield_repr

Attribute Macro bitfield_repr 

Source
#[bitfield_repr]
Expand description

Syntax sugar for defining a layout representation that also auto-derives the traits required of a custom bitfield representation.

In particular, #[bitfield_repr(...)] translates to

#[repr(...)]
#[derive(
    Debug,
    Eq,
    PartialEq,
    zerocopy::Immutable,
    zerocopy::IntoBytes,
    zerocopy::TryFromBytes,
)]