Trait BitIndex
Other items inhash_trie::traits
pub trait BitIndex { fn bit_index(&self, bit: Self) -> Result<usize, BitError>; }
BitIndex supports counting less significant 1s in the word (1s to the right of the bit).
BitIndex
fn bit_index(&self, bit: Self) -> Result<usize, BitError>
Count less significant 1s in the word (1s to the right of the bit) or return either BitError::CountNotEqualToOne or BitError::NotFound.
e.g. 0b110110.bit_index(0b100) == 1
0b110110.bit_index(0b100) == 1
impl BitIndex for u8
impl BitIndex for u16
impl BitIndex for u32
impl BitIndex for u64
impl BitIndex for u128
impl BitIndex for usize