bitx 0.2.2

More ergonomic way to deal with bitfield-like struct.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use bitx::bits;

// A dummy type mimicking a large struct
pub struct LargeData([u8; 32]);

impl bitx::Bits for LargeData {
    type Mask = ();
    const BITS: u32 = 256;
}

bits! {
    pub struct HugePacket: 33.0 {
        0.1 pub huge_field: LargeData,
        // unaligned extraction > 128 bits
    }
}

fn main() {}