pub unsafe trait Zeroable: Sized + Copy { }Expand description
Marker for Copy + Sized values that are valid for every bit pattern.
§Safety
This is the by-value contract: a Zeroable value can be produced
by copying size_of::<T>() arbitrary bytes (e.g. a zero fill, or an
unaligned read_unaligned). It says nothing about alignment, so
it holds for native multi-byte integers as well. To overlay a type as
&T / &mut T directly on account bytes, which requires
alignment 1, use Pod (and, at the framework level,
hopper_runtime::ZeroCopy).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".