Trait extra::container::Deque

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

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

Required Methods

fn front<'a>(&'a self) -> std::option::Option

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

fn front_mut<'a>(&'a mut self) -> std::option::Option

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

fn back<'a>(&'a self) -> std::option::Option

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

fn back_mut<'a>(&'a mut self) -> std::option::Option

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) -> std::option::Option

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

fn pop_front(&mut self) -> std::option::Option

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

Implementors