Trait BitBlock
trait BitBlock: Copy + Add<Self, Output = Self> + Sub<Self, Output = Self> + Shl<usize, Output = Self> + Shr<usize, Output = Self> + Not<Output = Self> + BitAnd<Self, Output = Self> + BitOr<Self, Output = Self> + BitXor<Self, Output = Self> + Rem<Self, Output = Self> + Eq + Ord + hash::Hash
Abstracts over a pile of bits (basically unsigned primitives)
Required Methods
fn bits() -> usizeHow many bits it has
fn from_byte(byte: u8) -> SelfConvert a byte into this type (lowest-order bits set)
fn count_ones(self: Self) -> usizeCount the number of 1's in the bitwise repr
fn zero() -> SelfGet
0fn one() -> SelfGet
1
Provided Methods
fn bytes() -> usizeHow many bytes it has
fn count_zeros(self: Self) -> usizeCount the number of 0's in the bitwise repr
Implementors
impl BitBlock for u64impl BitBlock for u32impl BitBlock for u16impl BitBlock for usizeimpl BitBlock for u8