pub unsafe trait Zeroable: Sized { }
Expand description
Marker Trait for types that can be safely created with
zeroed
.
An all-zeroes value may or may not be the same value as the Default value of the type.
§Safety
- Your type must be inhabited (eg: no Infallible).
- Your type must be allowed to be an “all zeroes” bit pattern (eg: no
NonNull<T>
).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.