pub trait Pod: Copy {
// Required method
fn type_id() -> u8;
}Expand description
Trait for datatypes that can be converted directly into bytes. This is required for the type to be used in the Vec of a PodVecView.
Required Methods§
Sourcefn type_id() -> u8
fn type_id() -> u8
A number which distinguishes each Pod type. Two distinct Pod types must not share the same type_id byte.
The type_id is stored with the data when a PodVecView is visited and used to confirm that the stored
data matches the expected type when reading. Otherwise garbage data could be read by interpreting an
array of i8 as an array of f32 or any other mismatched combination.
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.