pub struct TaggedNonNull<T: ?Sized>(/* private fields */);Expand description
A [NonNull<T>] pointer with a numerical tag.
The tag is split between the low alignment bits of the inner type, and the high order bits that are free due to the architecture virtual address width.
Implementations§
Source§impl<T> TaggedNonNull<T>
impl<T> TaggedNonNull<T>
pub const TAG_HIGH_BITS: u32 = 16
pub const TAG_LOW_BITS: u32
Sourcepub const MAXIMUM_TAG: usize
pub const MAXIMUM_TAG: usize
The (architecture- and type-dependent) maximum value the tag can hold.
Sourcepub fn addr_eq(&self, other: &Self) -> bool
pub fn addr_eq(&self, other: &Self) -> bool
Compares the addresses of the two pointers for equality, ignoring the tag value.
pub fn as_tagged_ptr(&self) -> NonNull<T>
pub fn from_tagged_ptr(ptr: NonNull<T>) -> Self
Trait Implementations§
Source§impl<T: Clone + ?Sized> Clone for TaggedNonNull<T>
impl<T: Clone + ?Sized> Clone for TaggedNonNull<T>
Source§fn clone(&self) -> TaggedNonNull<T>
fn clone(&self) -> TaggedNonNull<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Copy + ?Sized> Copy for TaggedNonNull<T>
Source§impl<T: Debug + ?Sized> Debug for TaggedNonNull<T>
impl<T: Debug + ?Sized> Debug for TaggedNonNull<T>
impl<T: Eq + ?Sized> Eq for TaggedNonNull<T>
Source§impl<T: Hash + ?Sized> Hash for TaggedNonNull<T>
impl<T: Hash + ?Sized> Hash for TaggedNonNull<T>
Source§impl<T: Ord + ?Sized> Ord for TaggedNonNull<T>
impl<T: Ord + ?Sized> Ord for TaggedNonNull<T>
Source§fn cmp(&self, other: &TaggedNonNull<T>) -> Ordering
fn cmp(&self, other: &TaggedNonNull<T>) -> Ordering
1.21.0 (const: unstable)§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
1.21.0 (const: unstable)§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T: PartialEq + ?Sized> PartialEq for TaggedNonNull<T>
impl<T: PartialEq + ?Sized> PartialEq for TaggedNonNull<T>
Source§impl<T: PartialOrd + ?Sized> PartialOrd for TaggedNonNull<T>
impl<T: PartialOrd + ?Sized> PartialOrd for TaggedNonNull<T>
Source§impl<T> Pointer for TaggedNonNull<T>
impl<T> Pointer for TaggedNonNull<T>
impl<T: PartialEq + ?Sized> StructuralPartialEq for TaggedNonNull<T>
Auto Trait Implementations§
impl<T> !Send for TaggedNonNull<T>
impl<T> !Sync for TaggedNonNull<T>
impl<T> Freeze for TaggedNonNull<T>where
NonNull<T>: Freeze,
T: ?Sized,
impl<T> RefUnwindSafe for TaggedNonNull<T>where
NonNull<T>: RefUnwindSafe,
T: ?Sized,
impl<T> Unpin for TaggedNonNull<T>where
NonNull<T>: Unpin,
T: ?Sized,
impl<T> UnsafeUnpin for TaggedNonNull<T>where
NonNull<T>: UnsafeUnpin,
T: ?Sized,
impl<T> UnwindSafe for TaggedNonNull<T>where
NonNull<T>: UnwindSafe,
T: ?Sized,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more