Skip to main content

VecConfigNew

Trait VecConfigNew 

Source
pub trait VecConfigNew<T>: VecConfigSpawn<T> {
    const EMPTY_BUFFER: Self::Buffer<T>;

    // Required method
    fn buffer_try_new(
        capacity: Self::Index,
        exact: bool,
    ) -> Result<Self::Buffer<T>, StorageError>;
}
Expand description

Support creation of new Vec instances without a storage reference.

Required Associated Constants§

Source

const EMPTY_BUFFER: Self::Buffer<T>

Constant initializer for an empty buffer.

Required Methods§

Source

fn buffer_try_new( capacity: Self::Index, exact: bool, ) -> Result<Self::Buffer<T>, StorageError>

Try to create a new buffer instance with a given capacity.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, A: AllocatorDefault, I: Index, G: Grow> VecConfigNew<T> for Custom<A, I, G>

Source§

const EMPTY_BUFFER: Self::Buffer<T> = FatBuffer::DEFAULT

Source§

impl<T, A: AllocatorDefault, I: Index, G: Grow> VecConfigNew<T> for Thin<A, I, G>

Source§

const EMPTY_BUFFER: Self::Buffer<T> = ThinBuffer<T, VecHeader<usize>, A>::DEFAULT

Source§

impl<T, A: AllocatorDefault> VecConfigNew<T> for A

Source§

const EMPTY_BUFFER: Self::Buffer<T> = FatBuffer<T, VecHeader<usize>, A>::DEFAULT

Source§

impl<T, const N: usize> VecConfigNew<T> for Inline<N>

Source§

const EMPTY_BUFFER: Self::Buffer<T> = InlineBuffer<T, N>::DEFAULT