Trait NthBit
Other items inhash_trie::traits
pub trait NthBit { fn nth_bit(n: usize) -> Result<Self, BitError> where Self: Sized; }
NthBit provides a word with only the nth bit set to 1.
NthBit
fn nth_bit(n: usize) -> Result<Self, BitError> where Self: Sized,
Get the nth bit of the given word size.
e.g. u32::nth_bit(4) == 0b10000
u32::nth_bit(4) == 0b10000
impl NthBit for u8
fn nth_bit(n: usize) -> Result<Self, BitError>
impl NthBit for u16
impl NthBit for u32
impl NthBit for u64
impl NthBit for u128
impl NthBit for usize