Rank

Trait Rank 

Source
pub trait Rank {
    // Required method
    fn try_rank(&self, index: usize) -> Option<usize>;

    // Provided methods
    fn rank(&self, index: usize) -> usize { ... }
    unsafe fn rank_unchecked(&self, index: usize) -> usize { ... }
    fn try_rank0(&self, index: usize) -> Option<usize> { ... }
    fn rank0(&self, index: usize) -> usize { ... }
    unsafe fn rank0_unchecked(&self, index: usize) -> usize { ... }
}
Expand description

Trait for rank queries on bit vector. Rank query returns the number of ones (or zeros) in requested number of the first bits.

Required Methods§

Source

fn try_rank(&self, index: usize) -> Option<usize>

Returns the number of ones in first index bits or None if index is out of bounds.

Provided Methods§

Source

fn rank(&self, index: usize) -> usize

Returns the number of ones in first index bits or panics if index is out of bounds.

Source

unsafe fn rank_unchecked(&self, index: usize) -> usize

Returns the number of ones in first index bits. The result is undefined if index is out of bounds.

Source

fn try_rank0(&self, index: usize) -> Option<usize>

Returns the number of zeros in first index bits or None if index is out of bounds.

Source

fn rank0(&self, index: usize) -> usize

Returns the number of zeros in first index bits or panics if index is out of bounds.

Source

unsafe fn rank0_unchecked(&self, index: usize) -> usize

Returns the number of ones in first index bits. The result is undefined if index is out of bounds.

Implementors§

Source§

impl<BV: Deref<Target = [u64]>> Rank for RankSimple<BV>

Source§

impl<S: SelectForRank101111, S0: Select0ForRank101111, BV: Deref<Target = [u64]>> Rank for RankSelect101111<S, S0, BV>