pub trait VecAllocExt<T, A: Allocator>: Sized + Sealed {
// Required methods
fn try_with_capacity_in(
capacity: usize,
alloc: A,
) -> Result<Self, AllocError>;
fn try_push(&mut self, value: T) -> Result<(), AllocError>;
fn try_resize(&mut self, new_len: usize, value: T) -> Result<(), AllocError>
where T: Copy;
fn try_resize_with<F>(
&mut self,
new_len: usize,
f: F,
) -> Result<(), AllocError>
where F: FnMut() -> T;
fn try_copy_from_slice(&mut self, other: &[T]) -> Result<(), AllocError>
where T: Copy;
}
Expand description
Extension for Vec<T, A>
Required Methods§
fn try_with_capacity_in(capacity: usize, alloc: A) -> Result<Self, AllocError>
fn try_push(&mut self, value: T) -> Result<(), AllocError>
fn try_resize(&mut self, new_len: usize, value: T) -> Result<(), AllocError>where
T: Copy,
fn try_resize_with<F>(&mut self, new_len: usize, f: F) -> Result<(), AllocError>where
F: FnMut() -> T,
fn try_copy_from_slice(&mut self, other: &[T]) -> Result<(), AllocError>where
T: Copy,
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.