pub unsafe trait ZeroCopy: StaticSize {
const ALIGN: usize;
}Available on crate feature
zero-copy only.Expand description
A marker trait indicating that a type has a fixed, predictable layout (e.g., #[repr(C)])
and contains no padding bytes or invalid bit patterns allowing safe zero-copy casting.
§Safety
The type must have a fixed, predictable layout (e.g., #[repr(C)]) and contain no padding bytes or invalid bit patterns allowing safe zero-copy casting.
Required Associated Constants§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".