pack_bools 0.1.2

Attribute macro to pack all boolean fields of a struct into a bitfield
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use pack_bools::pack_bools;

#[pack_bools(no_set)]
struct MyBools {
    a: bool,
    b: bool,
}

fn main() {
    let mut x = MyBools {
        packed_bools: 0
    };
    let y = x.get_a();
    x.set_b(true);
}