pub struct OrdInternerPool { /* private fields */ }Expand description
A lazy map from type to ord-based interner
This is the backing implementation for ord_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 OrdInternerPool
impl OrdInternerPool
pub fn new() -> Self
Sourcepub fn get<T>(&self) -> Option<OrdInterner<T>>
pub fn get<T>(&self) -> Option<OrdInterner<T>>
Obtain an interner for the given type if it has been created already.
Sourcepub fn get_or_create<T>(&mut self) -> OrdInterner<T>
pub fn get_or_create<T>(&mut self) -> OrdInterner<T>
Obtain an interner for the given type, create it if necessary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OrdInternerPool
impl !RefUnwindSafe for OrdInternerPool
impl Send for OrdInternerPool
impl Sync for OrdInternerPool
impl Unpin for OrdInternerPool
impl !UnwindSafe for OrdInternerPool
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