StorageWithCapacity

Trait StorageWithCapacity 

Source
pub unsafe trait StorageWithCapacity: Storage + Sized {
    // Required method
    fn with_capacity(capacity: usize) -> Self;
}
Expand description

A storage that can be initially created with a given capacity

§Safety

The storage must have a capacity of at least capacity after StorageWithCapacity::with_capacity is called.

Required Methods§

Source

fn with_capacity(capacity: usize) -> Self

Creates a new storage with at least the given storage capacity

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, A: Default + Allocator> StorageWithCapacity for Box<[MaybeUninit<T>], A>

Source§

fn with_capacity(cap: usize) -> Self

Source§

impl<T, const N: usize> StorageWithCapacity for [MaybeUninit<T>; N]

Source§

fn with_capacity(capacity: usize) -> Self

Implementors§