pub struct PointerIdentity<P: Pointer>(pub P);
Expand description
Wrapper type that uses the pointer address rather than the value as the identity for the
PartialEq
, Eq
, PartialOrd
, Ord
and Hash
traits.
This wrapper is transparent thanks to implementing both Deref
and DerefMut
, so you can
use an instance of this just like you would use an instance of the type you are wrapping.
Tuple Fields§
§0: P
Implementations§
Trait Implementations§
Source§impl<P: Clone + Pointer> Clone for PointerIdentity<P>
impl<P: Clone + Pointer> Clone for PointerIdentity<P>
Source§fn clone(&self) -> PointerIdentity<P>
fn clone(&self) -> PointerIdentity<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<P: Default + Pointer> Default for PointerIdentity<P>
impl<P: Default + Pointer> Default for PointerIdentity<P>
Source§fn default() -> PointerIdentity<P>
fn default() -> PointerIdentity<P>
Returns the “default value” for a type. Read more
Source§impl<P: Pointer> Deref for PointerIdentity<P>
impl<P: Pointer> Deref for PointerIdentity<P>
Source§impl<P: Pointer> DerefMut for PointerIdentity<P>
impl<P: Pointer> DerefMut for PointerIdentity<P>
Source§impl<P: Pointer> From<P> for PointerIdentity<P>
impl<P: Pointer> From<P> for PointerIdentity<P>
Source§impl<P: Pointer> Hash for PointerIdentity<P>
impl<P: Pointer> Hash for PointerIdentity<P>
Source§impl<P: Pointer> Ord for PointerIdentity<P>
impl<P: Pointer> Ord for PointerIdentity<P>
Source§impl<P: Pointer> PartialEq for PointerIdentity<P>
impl<P: Pointer> PartialEq for PointerIdentity<P>
Source§impl<P: Pointer> PartialOrd for PointerIdentity<P>
impl<P: Pointer> PartialOrd for PointerIdentity<P>
impl<P: Copy + Pointer> Copy for PointerIdentity<P>
impl<P: Pointer> Eq for PointerIdentity<P>
Auto Trait Implementations§
impl<P> Freeze for PointerIdentity<P>where
P: Freeze,
impl<P> RefUnwindSafe for PointerIdentity<P>where
P: RefUnwindSafe,
impl<P> Send for PointerIdentity<P>where
P: Send,
impl<P> Sync for PointerIdentity<P>where
P: Sync,
impl<P> Unpin for PointerIdentity<P>where
P: Unpin,
impl<P> UnwindSafe for PointerIdentity<P>where
P: UnwindSafe,
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