Reserve

Trait Reserve 

Source
pub trait Reserve {
    // Required method
    fn reserve_with_storage(&mut self, n: usize, storage_n: usize);

    // Provided method
    fn reserve(&mut self, n: usize) { ... }
}
Expand description

A trait that allows the container to allocate additional space without changing any of the data. The container should allocate space for at least n additional elements.

Composite collections such a Chunked or Select may choose to only reserve primary level storage if the amount of total storage required cannot be specified by a single number in reserve. This is the default behaviour of the reserve function below. The reserve_with_storage method allows the caller to also specify the amount of storage needed for the container at the lowest level.

Required Methods§

Source

fn reserve_with_storage(&mut self, n: usize, storage_n: usize)

Provided Methods§

Source

fn reserve(&mut self, n: usize)

Implementations on Foreign Types§

Source§

impl<T> Reserve for Vec<T>

Source§

fn reserve_with_storage(&mut self, n: usize, storage_n: usize)

Implementors§

Source§

impl<O: Reserve> Reserve for ClumpedOffsets<O>

Source§

impl<O: Reserve> Reserve for Offsets<O>

Source§

impl<S, I: Reserve> Reserve for Select<S, I>

Source§

impl<S: Reserve, N: Dimension> Reserve for UniChunked<S, N>

Source§

impl<S: Reserve, O: Reserve> Reserve for Chunked<S, O>

Source§

impl<S: Reserve, T, I: Reserve> Reserve for Sparse<S, T, I>