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

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.

Returns a reference to the item at the front of the queue.

Returns None if the queue is empty.

Removes the item at the front of the queue and returns it.

Returns None if the queue was empty.

Implementors