pub struct Interned<'a, T: ?Sized>(/* private fields */);
Expand description
An item interned by an Interner
.
As two equal interned items will always be the same reference, only the
reference is compared for equality rather than going to the potentially
expensive PartialEq
implementation on the concrete type.
In all other cases, this should act exactly as if it were a reference to the
wrapped type. To get the wrapped reference with the full lifetime, see
Interned::get
.
Implementations§
Trait Implementations§
Source§impl<'a, T: Ord + ?Sized> Ord for Interned<'a, T>
impl<'a, T: Ord + ?Sized> Ord for Interned<'a, T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, T: PartialOrd + ?Sized> PartialOrd for Interned<'a, T>
impl<'a, T: PartialOrd + ?Sized> PartialOrd for Interned<'a, T>
impl<T: ?Sized> Copy for Interned<'_, T>
impl<T: ?Sized> Eq for Interned<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Interned<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for Interned<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> Send for Interned<'a, T>
impl<'a, T> Sync for Interned<'a, T>
impl<'a, T> Unpin for Interned<'a, T>where
T: ?Sized,
impl<'a, T> UnwindSafe for Interned<'a, T>where
T: RefUnwindSafe + ?Sized,
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