Trait tantivy_columnar::column_index::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Set<u32> for OptionalIndex

§

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