Trait Set

Source
pub trait Set<T> {
    type SelectCursor<'b>: SelectCursor<T>
       where Self: 'b;

    // Required methods
    fn contains(&self, el: T) -> bool;
    fn rank(&self, el: T) -> T;
    fn rank_if_exists(&self, el: T) -> Option<T>;
    fn select(&self, rank: T) -> T;
    fn select_cursor(&self) -> Self::SelectCursor<'_>;
}

Required Associated Types§

Source

type SelectCursor<'b>: SelectCursor<T> where Self: 'b

Required Methods§

Source

fn contains(&self, el: T) -> bool

Returns true if the elements is contained in the Set

Source

fn rank(&self, el: T) -> T

Returns the number of rows in the set that are < el

Source

fn rank_if_exists(&self, el: T) -> Option<T>

If the set contains el returns the element rank. If the set does not contain the element, it returns None.

Source

fn select(&self, rank: T) -> T

Return the rank-th value stored in this bitmap.

§Panics

May panic if rank is greater or equal to the number of elements in the Set.

Source

fn select_cursor(&self) -> Self::SelectCursor<'_>

Creates a brand new select cursor.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Set<u32> for OptionalIndex

Source§

type SelectCursor<'b> = OptionalIndexSelectCursor<'b> where Self: 'b