Struct rustc_data_structures::tagged_ptr::TaggedPtr
source · pub struct TaggedPtr<P, T, const COMPARE_PACKED: bool>where
P: Pointer,
T: Tag,{
raw: CopyTaggedPtr<P, T, COMPARE_PACKED>,
}
Expand description
A tagged pointer that supports pointers that implement Drop
.
This is essentially { pointer: P, tag: T }
packed in a single pointer.
You should use CopyTaggedPtr
instead of the this type in all cases
where P
implements Copy
.
If COMPARE_PACKED
is true, then the pointers will be compared and hashed without
unpacking. Otherwise we don’t implement PartialEq
, Eq
and Hash
;
if you want that, wrap the TaggedPtr
.
Fields§
§raw: CopyTaggedPtr<P, T, COMPARE_PACKED>
Implementations§
Trait Implementations§
source§impl<P, T, const CP: bool> Debug for TaggedPtr<P, T, CP>where
P: Pointer + Debug,
T: Tag + Debug,
impl<P, T, const CP: bool> Debug for TaggedPtr<P, T, CP>where P: Pointer + Debug, T: Tag + Debug,
source§impl<P, T, const CP: bool> DerefMut for TaggedPtr<P, T, CP>where
P: Pointer + DerefMut,
T: Tag,
impl<P, T, const CP: bool> DerefMut for TaggedPtr<P, T, CP>where P: Pointer + DerefMut, T: Tag,
source§impl<P, T, HCX, const CP: bool> HashStable<HCX> for TaggedPtr<P, T, CP>where
P: Pointer + HashStable<HCX>,
T: Tag + HashStable<HCX>,
impl<P, T, HCX, const CP: bool> HashStable<HCX> for TaggedPtr<P, T, CP>where P: Pointer + HashStable<HCX>, T: Tag + HashStable<HCX>,
fn hash_stable(&self, hcx: &mut HCX, hasher: &mut StableHasher)
source§impl<P, T> PartialEq<TaggedPtr<P, T, true>> for TaggedPtr<P, T, true>where
P: Pointer,
T: Tag,
impl<P, T> PartialEq<TaggedPtr<P, T, true>> for TaggedPtr<P, T, true>where P: Pointer, T: Tag,
impl<P, T> Eq for TaggedPtr<P, T, true>where P: Pointer, T: Tag,
Auto Trait Implementations§
impl<P, T, const COMPARE_PACKED: bool> RefUnwindSafe for TaggedPtr<P, T, COMPARE_PACKED>where T: RefUnwindSafe, <P as Deref>::Target: RefUnwindSafe,
impl<P, T, const COMPARE_PACKED: bool> Send for TaggedPtr<P, T, COMPARE_PACKED>where P: Send, T: Send,
impl<P, T, const COMPARE_PACKED: bool> Sync for TaggedPtr<P, T, COMPARE_PACKED>where P: Sync, T: Sync,
impl<P, T, const COMPARE_PACKED: bool> Unpin for TaggedPtr<P, T, COMPARE_PACKED>where T: Unpin,
impl<P, T, const COMPARE_PACKED: bool> UnwindSafe for TaggedPtr<P, T, COMPARE_PACKED>where T: UnwindSafe, <P as Deref>::Target: RefUnwindSafe,
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
impl<'a, T> Captures<'a> for Twhere T: ?Sized,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.