[src]

Trait collections::deque::Deque

pub trait Deque<T>: Mutable {
    fn front<'a>(&'a self) -> Option<&'a T>;
    fn front_mut<'a>(&'a mut self) -> Option<&'a mut T>;
    fn back<'a>(&'a self) -> Option<&'a T>;
    fn back_mut<'a>(&'a mut self) -> Option<&'a mut T>;
    fn push_front(&mut self, elt: T);
    fn push_back(&mut self, elt: T);
    fn pop_back(&mut self) -> Option<T>;
    fn pop_front(&mut self) -> Option<T>;
}

A double-ended sequence that allows querying, insertion and deletion at both ends.

Required Methods

fn front<'a>(&'a self) -> Option<&'a T>

Provide a reference to the front element, or None if the sequence is empty

fn front_mut<'a>(&'a mut self) -> Option<&'a mut T>

Provide a mutable reference to the front element, or None if the sequence is empty

fn back<'a>(&'a self) -> Option<&'a T>

Provide a reference to the back element, or None if the sequence is empty

fn back_mut<'a>(&'a mut self) -> Option<&'a mut T>

Provide a mutable reference to the back element, or None if the sequence is empty

fn push_front(&mut self, elt: T)

Insert an element first in the sequence

fn push_back(&mut self, elt: T)

Insert an element last in the sequence

fn pop_back(&mut self) -> Option<T>

Remove the last element and return it, or None if the sequence is empty

fn pop_front(&mut self) -> Option<T>

Remove the first element and return it, or None if the sequence is empty

Implementors