Struct HashIndexing

Source
pub struct HashIndexing<T, D>
where T: Eq + Hash, D: SymbolId,
{ /* private fields */ }
Expand description

HashMap-backed table indexing.

Trait Implementations§

Source§

impl<T, D> Debug for HashIndexing<T, D>
where T: Eq + Hash + Debug, D: SymbolId + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T, D> Default for HashIndexing<T, D>
where T: Eq + Hash, D: SymbolId,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T, D> Indexing for HashIndexing<T, D>
where T: Eq + Hash, D: SymbolId,

Source§

type Data = T

The type T of a Table<T, D>.
Source§

type Id = D

The type D of a Table<T, D>.
Source§

fn from_table(table: Table<T, D>) -> Self

Returns a new indexing method that has already indexed the contents of table.
Source§

fn table(&self) -> &Table<Self::Data, Self::Id>

Returns a read-only view of the underlying table.
Source§

fn to_table(self) -> Table<Self::Data, Self::Id>

Extracts the underlying table from the index, discarding all pointers into the table.
Source§

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.
Source§

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.
Source§

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.

Auto Trait Implementations§

§

impl<T, D> Freeze for HashIndexing<T, D>
where D: Freeze,

§

impl<T, D> RefUnwindSafe for HashIndexing<T, D>

§

impl<T, D> Send for HashIndexing<T, D>
where T: Send,

§

impl<T, D> Sync for HashIndexing<T, D>
where T: Sync,

§

impl<T, D> Unpin for HashIndexing<T, D>
where D: Unpin,

§

impl<T, D> UnwindSafe for HashIndexing<T, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.