Expand description
This module implements tagged pointers. In order to utilize the pointer
packing, you must have a tag type implementing the Tag trait.
We assert that the tag and the reference type is compatible at compile time.
Re-exportsยง
use std::fmt;๐use std::hash::Hash;๐use std::hash::Hash;๐use std::hash::Hasher;๐use std::marker::PhantomData;๐use std::num::NonZero;๐use std::ops::Deref;๐use std::ptr::NonNull;๐use crate::aligned::Aligned;๐use crate::stable_hash::StableHash;๐use crate::stable_hash::StableHashCtxt;๐use crate::stable_hash::StableHasher;๐
Structsยง
- Tagged
Ref - A covariant
Copytagged borrow. This is essentially{ pointer: &'a P, tag: T }packed in a single reference.
Traitsยง
Functionsยง
- bits_
for - Returns the number of bits available for use for tags in a pointer to
T(this is based onTโs alignment). - bits_
for_ tags - Returns the correct
Tag::BITSconstant for a set of tag values.