#[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> PartialOrd for ByAddress<T>
impl<T> PartialOrd for ByAddress<T>
Raw pointer comparison
impl<T> Copy for ByAddress<T>
impl<T> Eq for ByAddress<T>
Auto Trait Implementations§
impl<T> Freeze for ByAddress<T>
impl<T> RefUnwindSafe for ByAddress<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for ByAddress<T>
impl<T> Sync for ByAddress<T>
impl<T> Unpin for ByAddress<T>
impl<T> UnwindSafe for ByAddress<T>where
T: UnwindSafe + ?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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)