pub trait Queue {
    type Item;

    fn push(&mut self, value: Self::Item) -> Result<(), PushError>;
    fn pop(&mut self) -> Option<Self::Item>;
    fn len(&self) -> usize;

    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait implemented by the queues used in the simulation.

Required Associated Types

Type of elements held by the queue.

Required Methods

Add an element to the queue.

Errors

Returns an error if the queue is bounded in size and full.

Removes the next element and returns it, or None if the Queue is empty.

Returns the number of elements in the queue.

Provided Methods

Returns true if there are no elements in the queue.

Implementors