WithCapacity

Trait WithCapacity 

Source
pub trait WithCapacity
where Self: Sized,
{ type Error; type Input; // Required method fn with_capacity(input: Self::Input) -> Result<Self, Self::Error>; }
Expand description

See WithCapacity::with_capacity for more information.

Required Associated Types§

Source

type Error

Error

Source

type Input

Input

Required Methods§

Source

fn with_capacity(input: Self::Input) -> Result<Self, Self::Error>

Creates a new instance based on an initial holding capacity provided by Input.

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, const N: usize> WithCapacity for [T; N]
where T: Default,

use cl_aux::Capacity;
let structure: [i32; 5];
structure = cl_aux::WithCapacity::with_capacity(0).unwrap();
assert_eq!(structure.capacity(), 5);

Implementors§