Trait PushFront

Source
pub trait PushFront<T>: PushBack<T> {
    // Required method
    fn push_front(&mut self, val: T) -> Option<Self::PushedOut>;
}
Expand description

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

Some collections have two locations to push values; for these collections, we assign one location as the “back” and the other as the “front.” See PushBack for more information, or use Push by itself if you don’t care where values are pushed.

Required Methods§

Source

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

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

Implementations on Foreign Types§

Source§

impl<T> PushFront<T> for LinkedList<T>

Source§

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

Source§

impl<T> PushFront<T> for VecDeque<T>

Source§

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

Implementors§

Source§

impl<T: AppendFront> PushFront<T> for T