pub trait PointerLike { }
🔬This is a nightly-only experimental API. (
pointer_like_trait
)Expand description
A marker for pointer-like types.
This trait can only be implemented for types that are certain to have
the same size and alignment as a usize
or *const ()
.
To ensure this, there are special requirements on implementations
of PointerLike
(other than the already-provided implementations
for built-in types):
- The type must have
#[repr(transparent)]
. - The type’s sole non-zero-sized field must itself implement
PointerLike
.