Trait any_vec::mem::MemBuilder

source ·
pub trait MemBuilder: Clone {
    type Mem: Mem;

    // Required method
    fn build(&mut self, element_layout: Layout) -> Self::Mem;
}
Expand description

This is Mem builder.

It can be stateful. You can use it like Allocator. Making MemBuilder default constructible, allow to use AnyVec::new, without that you limited to AnyVec::new_in.

Required Associated Types§

Required Methods§

source

fn build(&mut self, element_layout: Layout) -> Self::Mem

Object Safety§

This trait is not object safe.

Implementors§

source§

impl MemBuilder for Empty

§

type Mem = EmptyMem

source§

impl MemBuilder for Heap

§

type Mem = HeapMem

source§

impl<const N: usize, const SIZE: usize> MemBuilder for StackN<N, SIZE>

§

type Mem = StackNMem<N, SIZE>

source§

impl<const SIZE: usize> MemBuilder for Stack<SIZE>

§

type Mem = StackMem<SIZE>