Enum shortcut::idx::Index
[−]
[src]
pub enum Index<T> { Range(Box<RangeIndex<T> + Send + Sync>), Equality(Box<EqualityIndex<T> + Send + Sync>), }
A sum type expressing all different types of indices so they can easily be stored. Since all
indices must at least implement EqualityIndex
, this enum also forwards all calls of
that trait to the underlying index for convenience.
Variants
Range(Box<RangeIndex<T> + Send + Sync>)
A RangeIndex
trait object.
Equality(Box<EqualityIndex<T> + Send + Sync>)
An EqualityIndex
trait object.
Trait Implementations
impl<T> EqualityIndex<T> for Index<T>
[src]
fn lookup<'a>(&'a self, key: &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, key: T, row: usize)
Add the given row index to the index under the given value.
fn undex(&mut self, key: &T, row: 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. Read more
impl<T: Eq + Hash + 'static + Send + Sync> From<HashIndex<T>> for Index<T>
[src]
impl<T: Ord + Eq + 'static + Send + Sync> From<BTreeIndex<T>> for Index<T>
[src]
fn from(x: BTreeIndex<T>) -> Index<T>
Performs the conversion.