pub enum Index<T> {
Range(Box<dyn RangeIndex<T> + Send + Sync>),
Equality(Box<dyn EqualityIndex<T> + Send + Sync>),
}
Expand description
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<dyn RangeIndex<T> + Send + Sync>)
A RangeIndex
trait object.
Equality(Box<dyn EqualityIndex<T> + Send + Sync>)
An EqualityIndex
trait object.
Trait Implementations§
source§impl<T> EqualityIndex<T> for Index<T>
impl<T> EqualityIndex<T> for Index<T>
source§fn lookup<'a>(&'a self, key: &T) -> Box<dyn Iterator<Item = usize> + 'a>
fn lookup<'a>(&'a self, key: &T) -> Box<dyn Iterator<Item = usize> + 'a>
Return an iterator that yields the indices of all rows that match the given value.
source§fn index(&mut self, key: T, row: usize)
fn index(&mut self, key: T, row: usize)
Add the given row index to the index under the given value.