Struct scale_info::interner::Interner
source · [−]pub struct Interner<T> { /* private fields */ }
Expand description
Interning data structure generic over the element type.
For the sake of simplicity and correctness we are using a rather naive implementation.
Usage
This is used in order to quite efficiently cache strings and type definitions uniquely identified by their associated type identifiers.
Implementations
sourceimpl<T> Interner<T>where
T: Ord + Clone,
impl<T> Interner<T>where
T: Ord + Clone,
sourcepub fn intern_or_get(&mut self, s: T) -> (bool, Symbol<'_, T>)
pub fn intern_or_get(&mut self, s: T) -> (bool, Symbol<'_, T>)
Interns the given element or returns its associated symbol if it has already been interned.
Trait Implementations
sourceimpl<T: PartialEq> PartialEq<Interner<T>> for Interner<T>
impl<T: PartialEq> PartialEq<Interner<T>> for Interner<T>
impl<T: Eq> Eq for Interner<T>
impl<T> StructuralEq for Interner<T>
impl<T> StructuralPartialEq for Interner<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Interner<T>where
T: RefUnwindSafe,
impl<T> Send for Interner<T>where
T: Send,
impl<T> Sync for Interner<T>where
T: Sync,
impl<T> Unpin for Interner<T>where
T: Unpin,
impl<T> UnwindSafe for Interner<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more