[−][src]Macro sbp::parsable_bitflags
Declare a bitflags struct that can be parsed and serialized.
Only available if the bitflags
feature has been enabled.
Example
parsable_bitflags! { pub struct MyStruct: Le<u16> { const FLAG_A = 0x8; const FLAG_B = 0x10; const FLAG_C = 0x200; } } let bytes = [0x18, 0x02]; let (my_struct, _length) = MyStruct::parse((), &bytes)?; assert_eq!(my_struct, MyStruct::FLAG_A | MyStruct::FLAG_B | MyStruct::FLAG_C);