Trait WithCapacity

Source
pub trait WithCapacity {
    // Required method
    fn with_capacity(capacity: usize) -> Self;
}
Expand description

Trait for structs that can be constructed with a preallocated capacity.

Required Methods§

Source

fn with_capacity(capacity: usize) -> Self

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> WithCapacity for Vec<T>

Source§

fn with_capacity(capacity: usize) -> Self

Implementors§