Skip to content

0.11.0

Latest
Compare
Choose a tag to compare
@wrenger wrenger released this 04 May 13:54

Add the option to auto-generate std::hash::Hash as suggested by @freemin7 #62

#[bitfield(u32, hash = true)]
struct MyBitfield {
    data: u16,
    __: u8,
    #[bits(8)]
    extra: u8,
}

The hash implementation ignores any padding, but requires that all fields also implement Hash (similar to Debug).

Thanks to @freemin7 for suggesting this.