Trait stackvector::VecLike [−][src]
Common operations implemented by both Vec
and StackVec
.
This can be used to write generic code that works with both Vec
and StackVec
.
Example
use stackvector::{VecLike, StackVec}; fn initialize<V: VecLike<u8>>(v: &mut V) { for i in 0..5 { v.push(i); } } let mut vec = Vec::new(); initialize(&mut vec); let mut stack_vec = StackVec::<[u8; 8]>::new(); initialize(&mut stack_vec);
Required methods
fn push(&mut self, value: T)
[src]
Append an element to the vector.
fn pop(&mut self) -> Option<T>
[src]
Pop an element from the end of the vector.