pub trait WithCapacitywhere
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§
Required Methods§
Sourcefn with_capacity(input: Self::Input) -> Result<Self, Self::Error>
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);
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);