Trait qwt::RankBin

source ·
pub trait RankBin {
    // Required methods
    fn rank1(&self, i: usize) -> Option<usize>;
    unsafe fn rank1_unchecked(&self, i: usize) -> usize;

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

A trait for the support of rank query over the binary alphabet.

Required Methods§

source

fn rank1(&self, i: usize) -> Option<usize>

Returns the number of ones in the indexed sequence up to position i excluded.

source

unsafe fn rank1_unchecked(&self, i: usize) -> usize

Returns the number of ones in the indexed sequence up to position i excluded. None if the position is out of bound.

Safety

Calling this method with an out-of-bounds index is undefined behavior.

Provided Methods§

source

fn rank0(&self, i: usize) -> Option<usize>

Returns the number of zeros in the indexed sequence up to position i excluded.

source

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

Returns the number of zeros in the indexed sequence up to position i excluded.

Safety

Calling this method with an out-of-bounds index is undefined behavior.

Implementors§