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.

Implementations on Foreign Types§

Source§

impl<T, L> FlatBase for GenericVec<[MaybeInvalid<T>], L>
where T: Flat, L: Flat + Length,

Source§

const ALIGN: usize

Source§

const MIN_SIZE: usize = Self::DATA_OFFSET

Source§

fn size(&self) -> usize

Implementors§

Source§

impl<T> FlatBase for T
where T: FlatSized,

Source§

const ALIGN: usize

Source§

const MIN_SIZE: usize = Self::SIZE