Trait Extend

Source
pub trait Extend<T> {
    // Required methods
    fn reserve(&mut self, additional: usize);
    fn push(&mut self, item: T);
}
Expand description

A collection that can be used to receive the results of the [Path::extend][] method.

Note: There’s an open issue to add these methods to std’s Extend trait. If that gets merged, we can drop this trait and use the std one instead.

Required Methods§

Source

fn reserve(&mut self, additional: usize)

Reserve space for additional elements in the collection.

Source

fn push(&mut self, item: T)

Add a new element to the collection.

Implementations on Foreign Types§

Source§

impl<T> Extend<T> for VecDeque<T>

Source§

fn reserve(&mut self, additional: usize)

Source§

fn push(&mut self, item: T)

Source§

impl<T> Extend<T> for Vec<T>

Source§

fn reserve(&mut self, additional: usize)

Source§

fn push(&mut self, item: T)

Implementors§