Trait PushBack

Source
pub trait PushBack<T>: Push<T> {
    // Provided method
    fn push_back(&mut self, val: T) -> Option<Self::PushedOut> { ... }
}
Expand description

A trait for moving data onto the back of a collection.

Some collections have a particular location onto which new values are pushed, and the “back” refers to this canonical location. If you don’t care where values are pushed, you should use Push by itself instead.

Collections which have two locations to push values should also implement PushFront.

Provided Methods§

Source

fn push_back(&mut self, val: T) -> Option<Self::PushedOut>

Pushes the value onto the back, yielding the value that was pushed out, if any.

Implementations on Foreign Types§

Source§

impl PushBack<char> for String

Source§

impl PushBack<char> for Vec<u8>

Source§

impl PushBack<char> for Vec<u16>

Source§

impl PushBack<char> for Vec<u32>

Source§

impl<'a> PushBack<&'a str> for String

Source§

impl<'a> PushBack<&'a str> for OsString

Source§

impl<'a> PushBack<&'a OsStr> for OsString

Source§

impl<'a, T: 'a + Clone> PushBack<&'a [T]> for Vec<T>

Source§

impl<T> PushBack<T> for LinkedList<T>

Source§

impl<T> PushBack<T> for VecDeque<T>

Source§

impl<T> PushBack<T> for Vec<T>

Implementors§

Source§

impl<T: AppendBack> PushBack<T> for T