pub unsafe trait Plain: Copy + 'static { }Expand description
A type for which every bit pattern of its size is a valid value, so it can be read from and written to the target’s memory without checks.
Implemented for integers, floats, raw pointers to sized types, the string
types and arrays of plain types; generated bindings add enum newtypes and
all-plain structs and unions. bool, function pointers and references
have invalid bit patterns, so they aren’t plain.
§Safety
Every bit pattern of size_of::<Self>() bytes must be a valid value of
Self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".