#[repr(transparent)]pub struct Interned<'a, T: ?Sized>(pub &'a T, pub Private);Expand description
An Interned value is one that is referentially comparable. That is, the interned value is unique in memory, simplifying its equality and hashing implementation.
Comparing Interned values via PartialOrd or Ord will still dereference to the wrapped pointers, and as such, may produce results inconsistent with PartialEq or Eq.
Tuple Fields§
§0: &'a T§1: PrivateImplementations§
Trait Implementations§
Source§impl<T: ?Sized + Ord> Ord for Interned<'_, T>
impl<T: ?Sized + Ord> Ord for Interned<'_, T>
Source§impl<T: ?Sized + PartialOrd> PartialOrd for Interned<'_, T>
impl<T: ?Sized + PartialOrd> PartialOrd for Interned<'_, 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