struct TyIntern<T: Clone + Eq> {
items: Vec<T>,
set: HashMap<T, Interned<T>>,
}
Expand description
A structure for managing the interning of values of type T
.
TyIntern<T>
maintains a mapping between values and their interned representations,
ensuring that duplicate values are not stored multiple times.
Fields§
§items: Vec<T>
§set: HashMap<T, Interned<T>>
Implementations§
Source§impl<T: Hash + Clone + Eq> TyIntern<T>
impl<T: Hash + Clone + Eq> TyIntern<T>
Sourcefn intern_borrow<B>(&mut self, item: &B) -> Interned<T>
fn intern_borrow<B>(&mut self, item: &B) -> Interned<T>
Interns a borrowed value, ensuring it is stored uniquely.
If the value has been previously interned, the same Interned<T>
instance is returned.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TyIntern<T>
impl<T> RefUnwindSafe for TyIntern<T>where
T: RefUnwindSafe,
impl<T> Send for TyIntern<T>where
T: Send,
impl<T> Sync for TyIntern<T>where
T: Sync,
impl<T> Unpin for TyIntern<T>where
T: Unpin,
impl<T> UnwindSafe for TyIntern<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
§impl<T> Pointable for T
impl<T> Pointable for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes