[][src]Trait smallvec::ExtendFromSlice

pub trait ExtendFromSlice<T> {
    fn extend_from_slice(&mut self, other: &[T]);

Trait to be implemented by a collection that can be extended from a slice


use smallvec::{ExtendFromSlice, SmallVec};

fn initialize<V: ExtendFromSlice<u8>>(v: &mut V) {

let mut vec = Vec::new();
initialize(&mut vec);
assert_eq!(&vec, b"Test!");

let mut small_vec = SmallVec::<[u8; 8]>::new();
initialize(&mut small_vec);
assert_eq!(&small_vec as &[_], b"Test!");

Required methods

fn extend_from_slice(&mut self, other: &[T])

Extends a collection from a slice of its element type

Loading content...

Implementations on Foreign Types

impl<T: Clone> ExtendFromSlice<T> for Vec<T>[src]

Loading content...


impl<A: Array> ExtendFromSlice<<A as Array>::Item> for SmallVec<A> where
    A::Item: Copy

Loading content...