Trait ZeroablePrimitive
unsafe trait ZeroablePrimitive: Sized + Copy + private::Sealed
A marker trait for primitive types which can be zero.
This is an implementation detail for [NonZero]<T> which may disappear or be replaced at any time.
Safety
Types implementing this trait must be primitives that are valid when zeroed.
The associated Self::NonZeroInner type must have the same size+align as Self,
but with a niche and bit validity making it so the following transmutes are sound:
Self::NonZeroInnertoOption<Self::NonZeroInner>Option<Self::NonZeroInner>toSelf
(And, consequently, Self::NonZeroInner to Self.)
Associated Types
type NonZeroInner: TraitBound { trait_: Path { path: "Sized", id: Id(12), args: None }, generic_params: [], modifier: None } + TraitBound { trait_: Path { path: "Copy", id: Id(6), args: None }, generic_params: [], modifier: None }A type like
Selfbut with a niche that includes zero.
Implementors
impl ZeroablePrimitive for u8impl ZeroablePrimitive for i64impl ZeroablePrimitive for usizeimpl ZeroablePrimitive for u16impl ZeroablePrimitive for i128impl ZeroablePrimitive for i8impl ZeroablePrimitive for u32impl ZeroablePrimitive for isizeimpl ZeroablePrimitive for i16impl ZeroablePrimitive for u64impl ZeroablePrimitive for charimpl ZeroablePrimitive for i32impl ZeroablePrimitive for u128