Pod

Trait Pod 

Source
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§

Source

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.

Implementations on Foreign Types§

Source§

impl Pod for f32

Source§

impl Pod for f64

Source§

impl Pod for i8

Source§

impl Pod for i16

Source§

impl Pod for i32

Source§

impl Pod for i64

Source§

impl Pod for u8

Source§

impl Pod for u16

Source§

impl Pod for u32

Source§

impl Pod for u64

Implementors§