Trait bit_struct::BitCount [−][src]
Expand description
A trait which defines how many bits are needed to store a struct.
Safety
Define Num
as {i,u}{8,16,32,64,128}
.
- when calling
core::mem::transmute
onSelf
, only bits [0, COUNT) can be non-zero - TryFrom
produces Some(x) <=> core::mem::transmute(num) produces a valid Self(x) - TryFrom
produces None <=> core::mem::transmute(num) produces an invalid state for Self