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§
Source§impl<'a, T: Default + Eq + Hash> Default for TypedInterner<'a, T>
impl<'a, T: Default + Eq + Hash> Default for TypedInterner<'a, T>
Source§fn default() -> TypedInterner<'a, T>
fn default() -> TypedInterner<'a, T>
Returns the “default value” for a type. Read more
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<T: Eq + Hash + Send + Sync> Sync for TypedInterner<'_, 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