FlatBase

Trait FlatBase 

Source
pub unsafe trait FlatBase: Send + Sync {
    const ALIGN: usize;
    const MIN_SIZE: usize;

    // Required method
    fn size(&self) -> usize;
}
Expand description

Basic flat type properties.

Required Associated Constants§

Source

const ALIGN: usize

Align of the type.

Source

const MIN_SIZE: usize

Minimal size of an instance of the type.

Required Methods§

Source

fn size(&self) -> usize

Size of an instance of the type.

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.

Implementors§

Source§

impl<T, L> FlatBase for FlatVec<T, L>
where T: Flat + Sized, L: Flat + Length,

Source§

const ALIGN: usize

Source§

const MIN_SIZE: usize = Self::DATA_OFFSET

Source§

impl<T: FlatSized> FlatBase for T

Source§

const ALIGN: usize

Source§

const MIN_SIZE: usize = Self::SIZE