pub trait TensorVec{
type Item;
type Slice<'a>;
// Required methods
fn append(&mut self, other: &mut Self);
fn is_empty(&self) -> bool;
fn len(&self) -> usize;
fn new(slice: Self::Slice<'_>) -> 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;
fn zero(len: usize) -> Self;
}
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 items of other into self, leaving other empty.
Sourcefn len(&self) -> usize
fn len(&self) -> usize
Returns the number of items in the vector, also referred to as its ‘length’.
Sourcefn remove(&mut self, _index: usize) -> Self::Item
fn remove(&mut self, _index: usize) -> Self::Item
Removes an item from the Vec and returns it, shifting items to the left.
Sourcefn swap_remove(&mut self, _index: usize) -> Self::Item
fn swap_remove(&mut self, _index: usize) -> Self::Item
Removes an item from the Vec and returns it, replacing it the last item.
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.