[−][src]Trait idata::cont::IVec
Some operations to work with vectors
Required methods
fn ipush(self, _: T) -> Self
Push an element to a vector, and return the same vector
extern crate idata; use idata::cont::IVec; fn main() { let v = vec![1, 2]; let v = v.ipush(3) .ipush(4); assert!(v == vec![1,2,3,4]); }
fn iappend(self, _: Vec<T>) -> Self
Append a vector to another
extern crate idata; use idata::cont::IVec; fn main() { let v1 = vec![1, 2]; let v2 = vec![3, 4, 5]; let v1 = v1.iappend(v2); assert!(v1 == vec![1,2,3,4, 5]); }
fn ipop(self) -> (Option<T>, Self)
Remove an element from back of a vector
extern crate idata; use idata::cont::IVec; fn main() { let v1 = vec![1, 2, 3, 4, 5, 6]; let (o, v1) = v1.ipop(); assert!(v1 == vec![1,2,3,4, 5]); assert!(o.unwrap() == 6); }