pub struct Interner<T> { /* private fields */ }Implementations§
Source§impl<T> Interner<T>
impl<T> Interner<T>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates an empty Interner. The current implementation does not allocate
pub fn insert_arena(&self, value: T) -> &mut T
Source§impl<T: Hash + Eq> Interner<T>
impl<T: Hash + Eq> Interner<T>
Sourcepub fn try_resolve<Q>(&self, value: &Q) -> Option<&T>
pub fn try_resolve<Q>(&self, value: &Q) -> Option<&T>
Will return a reference to an equivalent value if it already exists
Sourcepub fn intern(&self, value: T) -> &T
pub fn intern(&self, value: T) -> &T
Returns a reference to either the value provided, or an equivalent value that was already inserted
Sourcepub fn intern_new(&self, value: T) -> &T
pub fn intern_new(&self, value: T) -> &T
Inserts the value into the interner without checking if the value already exists
Sourcepub fn intern_ref_unique(&self, value: &'static T)
pub fn intern_ref_unique(&self, value: &'static T)
Inserts a reference to the value into the interner.
All future calls the Interner::intern will return the provided reference.
This function will not check if an equivalent value already exists within the table, and may behave weirdly if one does.
Trait Implementations§
impl<T: Send> Send for Interner<T>
impl<T: Sync> Sync for Interner<T>
Auto Trait Implementations§
impl<T> !Freeze for Interner<T>
impl<T> RefUnwindSafe for Interner<T>
impl<T> Unpin for Interner<T>where
T: Unpin,
impl<T> UnwindSafe for Interner<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more