Struct symbol_map::indexing::HashIndexing
[−]
[src]
pub struct HashIndexing<T, D> where T: Eq + Hash, D: SymbolId {
// some fields omitted
}
HashMap-backed table indexing.
Trait Implementations
impl<T, D> Default for HashIndexing<T, D> where T: Eq + Hash, D: SymbolId
[src]
impl<T, D> Indexing for HashIndexing<T, D> where T: Eq + Hash, D: SymbolId
[src]
type Data = T
The type T
of a Table<T, D>
.
type Id = D
The type D
of a Table<T, D>
.
fn from_table(table: Table<T, D>) -> Self
Returns a new indexing method that has already indexed the contents of table
. Read more
fn table(&self) -> &Table<Self::Data, Self::Id>
Returns a read-only view of the underlying table.
fn to_table(self) -> Table<Self::Data, Self::Id>
Extracts the underlying table from the index, discarding all pointers into the table. Read more
fn get<'s>(&'s self, data: &T) -> Option<&'s Symbol<T, D>>
Looks up data
in the index. Returns Some(&symbol)
if a symbol is present, else None
. Read more
fn get_or_insert<'s>(&'s mut self, data: T) -> Insertion<&'s Symbol<T, D>>
Looks up data
in the index, inserting it into the index and table
if it isn't present. Returns the resulting &Symbol<T>
wrapped in an Insertion
that indicates whether a new table entry had to be created. Read more
fn get_symbol<'s>(&'s self, id: &D) -> Option<&'s Symbol<T, D>>
Looks up the symbol with id i
in the index. Returns Some(symbol)
if a symbol is present, else None
. Read more