Trait eclectic::Queue
[−]
[src]
pub trait Queue: Collection + Iter { fn push(&mut self, item: Self::Item) where Self: AddRemove; fn front(&self) -> Option<&Self::Item>; fn pop_front(&mut self) -> Option<Self::Item> where Self: AddRemove; }
A queue.
Required Methods
fn push(&mut self, item: Self::Item) where Self: AddRemove
Pushes the given item onto the queue.
For FIFO queues, this pushes the item onto the back of the queue. For other queues, the location of the newly inserted item is unspecified.
fn front(&self) -> Option<&Self::Item>
Returns a reference to the item at the front of the queue.
Returns None
if the queue is empty.
fn pop_front(&mut self) -> Option<Self::Item> where Self: AddRemove
Removes the item at the front of the queue and returns it.
Returns None
if the queue was empty.
Implementors
impl<T: Ord> Queue for BinaryHeap<T>
impl<T> Queue for LinkedList<T>
impl<T> Queue for VecDeque<T>