pub struct TaggedPtr(/* private fields */);Expand description
A pointer that uses the high bit (bit 63) as a tag to indicate wide vs thin.
- Bit 63 = 0: thin pointer (sized type, no metadata needed)
- Bit 63 = 1: wide pointer (unsized type, has metadata)
This works because user-space addresses on 64-bit Linux/macOS/Windows never use bit 63 (they’re limited to 48-57 bits).
Implementations§
Trait Implementations§
impl Copy for TaggedPtr
impl Eq for TaggedPtr
impl StructuralPartialEq for TaggedPtr
Auto Trait Implementations§
impl Freeze for TaggedPtr
impl RefUnwindSafe for TaggedPtr
impl !Send for TaggedPtr
impl !Sync for TaggedPtr
impl Unpin for TaggedPtr
impl UnwindSafe for TaggedPtr
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