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

pub trait EqualityIndex<T> {
    fn lookup<'a>(&'a self, &T) -> Box<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<Iterator<Item=usize> + 'a>

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

fn index(&mut self, T, usize)

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

fn undex(&mut self, T, usize)

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

fn estimate(&self) -> usize

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.

Implementors