pub struct HashInternerPool { /* private fields */ }Expand description
A lazy map from type to hash-based interner
This is the backing implementation for hash_interner(), you
can use it if you want the ability to drop the whole pool (note, though, that this will
not drop the interned values — they are kept alive by the references you keep to them
and are automatically freed when they are no longer references).
Implementations§
Source§impl HashInternerPool
impl HashInternerPool
pub fn new() -> Self
Sourcepub fn get<T>(&self) -> Option<HashInterner<T>>
pub fn get<T>(&self) -> Option<HashInterner<T>>
Obtain an interner for the given type if it has been created already.
Sourcepub fn get_or_create<T>(&mut self) -> HashInterner<T>
pub fn get_or_create<T>(&mut self) -> HashInterner<T>
Obtain an interner for the given type, create it if necessary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HashInternerPool
impl !RefUnwindSafe for HashInternerPool
impl Send for HashInternerPool
impl Sync for HashInternerPool
impl Unpin for HashInternerPool
impl !UnwindSafe for HashInternerPool
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