Trait collection::VectorOps
[−]
[src]
pub trait VectorOps<T, M> where Self: Sized, T: Val, M: Meta<T> {
fn insert(&mut self, i: usize, t: T);
fn remove(&mut self, i: usize) -> Option<T>;
fn get(&self, i: usize) -> Option<&T>;
fn get_mut(&mut self, i: usize) -> Option<MutContext<T, M, Beginning>>;
fn push(&mut self, t: T);
fn pop(&mut self) -> Option<T>;
fn split(&mut self, i: usize) -> (Self, Self);
fn concat(&mut self, b: &mut Self) -> Self;
fn splice(&mut self, i: usize, from: &mut Self) -> Self;
}
Vector Operations on a Collection
Required Methods
fn insert(&mut self, i: usize, t: T)
Insert element at index i
fn remove(&mut self, i: usize) -> Option<T>
Remove element from index i
fn get(&self, i: usize) -> Option<&T>
Get a reference to element at index i
fn get_mut(&mut self, i: usize) -> Option<MutContext<T, M, Beginning>>
Get a mutable reference to element at index i
fn push(&mut self, t: T)
Push element to end of vector
fn pop(&mut self) -> Option<T>
Pop from the end of the vector
fn split(&mut self, i: usize) -> (Self, Self)
Split the vector in two at index i
fn concat(&mut self, b: &mut Self) -> Self
Concatenate two vectors
fn splice(&mut self, i: usize, from: &mut Self) -> Self
Splice in a vector at index i
Implementors
impl<T, M> VectorOps<T, M> for Collection<T, M> where T: Val, M: Meta<T> + SubMeta<Cardinality<usize>>