pub unsafe trait Tag: Copy {
    const BITS: usize;

    // Required methods
    fn into_usize(self) -> usize;
    unsafe fn from_usize(tag: usize) -> Self;
}
Expand description

This describes tags that the TaggedPtr struct can hold.

Safety

The BITS constant must be correct.

No more than BITS least significant bits may be set in the returned usize.

Required Associated Constants§

Required Methods§

source

fn into_usize(self) -> usize

source

unsafe fn from_usize(tag: usize) -> Self

Safety

The passed tag must be returned from into_usize.

Implementors§