pub struct DroplessInterner<'a, T: Eq + Hash> {
arena: DroplessArena<'a>,
keys: RwLock<HashSet<&'a T>>,
}Expand description
A DroplessInterner hands out Interned references for arbitrary types.
See the module-level documentation for more information.
Fields§
§arena: DroplessArena<'a>§keys: RwLock<HashSet<&'a T>>Implementations§
Source§impl<'a, T: Eq + Hash> DroplessInterner<'a, T>
impl<'a, T: Eq + Hash> DroplessInterner<'a, T>
Sourcepub fn new(arena: DroplessArena<'a>) -> Self
pub fn new(arena: DroplessArena<'a>) -> Self
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 DroplessInterner<'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 DroplessInterner<'_, T>
Auto Trait Implementations§
impl<'a, T> !Freeze for DroplessInterner<'a, T>
impl<'a, T> !RefUnwindSafe for DroplessInterner<'a, T>
impl<'a, T> Unpin for DroplessInterner<'a, T>
impl<'a, T> UnwindSafe for DroplessInterner<'a, 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