Struct by_address::ByAddress
source · #[repr(transparent)]pub struct ByAddress<T>(pub T)
where
T: ?Sized + Deref;
Expand description
Wrapper for pointer types that implements by-address comparison.
See the crate-level documentation for details.
Equality tests and hashes on fat pointers (&dyn Trait
, &[T]
, &str
, etc)
include the attribute of the fat pointer.
However, note that comparing fat pointers to trait objects can be unreliable because of
Rust issue #46139. In some cases,
ByThinAddress
may be more useful.
Tuple Fields§
§0: T
Implementations§
Trait Implementations§
source§impl<T> PartialEq for ByAddress<T>
impl<T> PartialEq for ByAddress<T>
Raw pointer equality
source§impl<T> PartialOrd for ByAddress<T>
impl<T> PartialOrd for ByAddress<T>
Raw pointer comparison
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T> Copy for ByAddress<T>
impl<T> Eq for ByAddress<T>
Auto Trait Implementations§
impl<T: ?Sized> Freeze for ByAddress<T>where
T: Freeze,
impl<T: ?Sized> RefUnwindSafe for ByAddress<T>where
T: RefUnwindSafe,
impl<T: ?Sized> Send for ByAddress<T>where
T: Send,
impl<T: ?Sized> Sync for ByAddress<T>where
T: Sync,
impl<T: ?Sized> Unpin for ByAddress<T>where
T: Unpin,
impl<T: ?Sized> UnwindSafe for ByAddress<T>where
T: 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