pub trait BitArray {
    fn bit(&self, idx: usize) -> bool;
fn bit_slice(&self, start: usize, end: usize) -> Self;
fn mask(&self, n: usize) -> Self;
fn trailing_zeros(&self) -> usize;
fn zero() -> Self;
fn one() -> Self;
fn max() -> Self; }
Expand description

A trait which allows numbers to act as fixed-size bit arrays

Required methods

Is bit set?

Returns an array which is just the bits from start to end

Bitwise and with n ones

Trailing zeros

Create all-zeros value

Create value represeting one

Create value representing max

Implementors