Trait Layout

Source
pub trait Layout: Sealed + HList {
    type Flat: FlatLayout;

    const ALIGNMENT: u32;

    // Required method
    fn flatten(self) -> Self::Flat;
}
Expand description

Representation of the memory layout of complex types as a sequence of fundamental WIT types.

Required Associated Constants§

Source

const ALIGNMENT: u32

The alignment boundary required for the layout.

Required Associated Types§

Source

type Flat: FlatLayout

Result of flattening this layout.

Required Methods§

Source

fn flatten(self) -> Self::Flat

Flattens this layout into a layout consisting of native WebAssembly types.

The resulting flat layout does not have any empty items.

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 Layout for HNil

Source§

impl<Head, Tail> Layout for HCons<Head, Tail>
where Head: LayoutElement, Tail: Layout,

Source§

const ALIGNMENT: u32

Source§

type Flat = <<Head as LayoutElement>::Flat as MaybeFlatType>::Flatten<Tail>