Trait succinct::rank::RankSupport
[−]
[src]
pub trait RankSupport { type Over: Copy; fn rank(&self, position: u64, value: Self::Over) -> u64; fn limit(&self) -> u64; }
Interface for types that support rank queries.
Associated type Over
gives the type that we can query about. For
example, RankSupport<Over=bool>
lets us rank 0
and 1
, whereas
RankSupport<Over=u8>
will rank arbitrary bytes.
Associated Types
Required Methods
fn rank(&self, position: u64, value: Self::Over) -> u64
Returns the rank of the given value at a given position.
This is the number of occurrences of value
up to and including
that position.
fn limit(&self) -> u64
The size of the vector being ranked.
Rank queries beyond this point will continue to return the same
value, so you can think of limit
as one past the end of the
last place that the rank changes.
Implementors
impl<'a, Store: ?Sized + Bits + 'a> RankSupport for JacobsonRank<'a, Store>
impl<'a, Rank: RankSupport + 'a> RankSupport for BinSearchSelect<'a, Rank>