[−][src]Trait smallvec::VecLike
Deprecated:
Use Extend
and Deref<[T]>
instead
Common operations implemented by both Vec
and SmallVec
.
This can be used to write generic code that works with both Vec
and SmallVec
.
Example
use smallvec::{VecLike, SmallVec}; 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 small_vec = SmallVec::<[u8; 8]>::new(); initialize(&mut small_vec);
Required methods
fn push(&mut self, value: T)
Deprecated:
Use Extend
and Deref<[T]>
instead
Append an element to the vector.