pub trait AnyVec<T>{
// Required methods
fn extend(&mut self, elements: &[T]) -> Result<(), MemoryError>
where T: Clone;
fn insert(&mut self, index: usize, element: T) -> Result<(), MemoryError>;
// Provided methods
fn new(elements: &[T]) -> Result<Self, MemoryError>
where T: Clone { ... }
fn push(&mut self, element: T) -> Result<(), MemoryError> { ... }
}
Expand description
A bridge trait to unify required vector operations over multiple implementations
Required Methods§
Provided Methods§
Sourcefn new(elements: &[T]) -> Result<Self, MemoryError>where
T: Clone,
fn new(elements: &[T]) -> Result<Self, MemoryError>where
T: Clone,
Creates a new vector by copying the given elements
Sourcefn push(&mut self, element: T) -> Result<(), MemoryError>
fn push(&mut self, element: T) -> Result<(), MemoryError>
Pushes an element to the end of the vector
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.