pub trait TensorVec{
type Item;
// Required methods
fn append(&mut self, other: &mut Self);
fn capacity(&self) -> usize;
fn is_empty(&self) -> bool;
fn new() -> Self;
fn push(&mut self, item: Self::Item);
fn remove(&mut self, _index: usize) -> Self::Item;
fn retain<F>(&mut self, f: F)
where F: FnMut(&Self::Item) -> bool;
fn swap_remove(&mut self, _index: usize) -> Self::Item;
}Expand description
Common methods for tensors derived from Vec.
Required Associated Types§
Required Methods§
Sourcefn append(&mut self, other: &mut Self)
fn append(&mut self, other: &mut Self)
Moves all the elements of other into self, leaving other empty.
Sourcefn capacity(&self) -> usize
fn capacity(&self) -> usize
Returns the total number of elements the vector can hold without reallocating.
Sourcefn new() -> Self
fn new() -> Self
Constructs a new, empty Vec, not allocating until elements are pushed onto it.
Sourcefn remove(&mut self, _index: usize) -> Self::Item
fn remove(&mut self, _index: usize) -> Self::Item
Removes an element from the Vec and returns it, shifting elements to the left.
Sourcefn swap_remove(&mut self, _index: usize) -> Self::Item
fn swap_remove(&mut self, _index: usize) -> Self::Item
Removes an element from the Vec and returns it, replacing it with the last element.
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.