Trait std::collections::Deque[src]
pub trait Deque<T>: Mutable {
fn front<T>(&'a self) -> Option<&'a T>;
fn front_mut<T>(&'a mut self) -> Option<&'a mut T>;
fn back<T>(&'a self) -> Option<&'a T>;
fn back_mut<T>(&'a mut self) -> Option<&'a mut T>;
fn push_front<T>(&mut self, elt: T);
fn push_back<T>(&mut self, elt: T);
fn pop_back<T>(&mut self) -> Option<T>;
fn pop_front<T>(&mut self) -> Option<T>;
}A double-ended sequence that allows querying, insertion and deletion at both ends.
Required Methods
fn front<T>(&'a self) -> Option<&'a T>
Provide a reference to the front element, or None if the sequence is empty
fn front_mut<T>(&'a mut self) -> Option<&'a mut T>
Provide a mutable reference to the front element, or None if the sequence is empty
fn back<T>(&'a self) -> Option<&'a T>
Provide a reference to the back element, or None if the sequence is empty
fn back_mut<T>(&'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<T>(&mut self, elt: T)
Insert an element first in the sequence
fn push_back<T>(&mut self, elt: T)
Insert an element last in the sequence
fn pop_back<T>(&mut self) -> Option<T>
Remove the last element and return it, or None if the sequence is empty
fn pop_front<T>(&mut self) -> Option<T>
Remove the first element and return it, or None if the sequence is empty