pub unsafe trait WireType: Sized + Copy {
const WIRE_SIZE: usize;
const CANONICAL_NAME: &'static str;
}Expand description
Marker trait for types safe to use as zero-copy wire fields.
§Safety
Implementors must guarantee:
align_of::<Self>() == 1size_of::<Self>() == Self::WIRE_SIZE- All bit patterns are valid (no invalid states)
- The type is
Copyand has no drop glue
Required Associated Constants§
Sourceconst CANONICAL_NAME: &'static str
const CANONICAL_NAME: &'static str
The canonical type name for schema/fingerprint generation.
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.