Struct cl_structures::intern::typed_interner::TypedInterner
source · pub struct TypedInterner<'a, T: Eq + Hash> { /* private fields */ }
Expand description
A TypedInterner hands out Interned references for arbitrary types.
See the module-level documentation for more information.
Implementations§
source§impl<'a, T: Eq + Hash> TypedInterner<'a, T>
impl<'a, T: Eq + Hash> TypedInterner<'a, T>
sourcepub fn new(arena: TypedArena<'a, T>) -> Self
pub fn new(arena: TypedArena<'a, T>) -> Self
Creates a new TypedInterner backed by the provided TypedArena
sourcepub fn get_or_insert(&'a self, value: T) -> Interned<'a, T>
pub fn get_or_insert(&'a self, value: T) -> Interned<'a, T>
Trait Implementations§
impl<'a, T: Eq + Hash + Send> Send for TypedInterner<'a, T>
§Safety
This should be safe because references yielded by get_or_insert are unique, and the function uses the RwLock around the HashSet to ensure mutual exclusion
impl<'a, T: Eq + Hash + Send + Sync> Sync for TypedInterner<'a, T>
Auto Trait Implementations§
impl<'a, T> !Freeze for TypedInterner<'a, T>
impl<'a, T> !RefUnwindSafe for TypedInterner<'a, T>
impl<'a, T> Unpin for TypedInterner<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for TypedInterner<'a, T>where
T: UnwindSafe + RefUnwindSafe,
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