Trait shortcut::idx::EqualityIndex[][src]

pub trait EqualityIndex<T> {
    fn lookup<'a>(&'a self, _: &T) -> Box<dyn Iterator<Item = usize> + 'a>;
fn index(&mut self, _: T, _: usize);
fn undex(&mut self, _: &T, _: usize);
fn estimate(&self) -> usize; }

An EqualityIndex is an index that can perform efficient equality lookups.

Required methods

fn lookup<'a>(&'a self, _: &T) -> Box<dyn Iterator<Item = usize> + 'a>[src]

Return an iterator that yields the indices of all rows that match the given value.

fn index(&mut self, _: T, _: usize)[src]

Add the given row index to the index under the given value.

fn undex(&mut self, _: &T, _: usize)[src]

Remove the given row index under the given value from the index.

fn estimate(&self) -> usize[src]

Give the expected number of rows returned for a key. This method may be called often, and in rapid succession, and so should return quickly.

Loading content...

Implementors

impl<T> EqualityIndex<T> for Index<T>[src]

impl<T: Eq + Hash> EqualityIndex<T> for HashIndex<T>[src]

impl<T: Ord + Eq> EqualityIndex<T> for BTreeIndex<T>[src]

Loading content...