Struct im::queue::Queue [] [src]

pub struct Queue<A>(_, _);

A strict queue backed by a pair of linked lists.

All operations run in O(1) amortised time, but the pop operation may run in O(n) time in the worst case.

Methods

impl<A> Queue<A>
[src]

Construct an empty queue.

Test whether a queue is empty.

Time: O(1)

Get the length of a queue.

Time: O(1)

Construct a new queue by appending an element to the end of the current queue.

Time: O(1)

Get the first element out of a queue, as well as the remainder of the queue.

Returns None if the queue is empty. Otherwise, you get a tuple of the first element and the remainder of the queue.

Get an iterator over a queue.

Trait Implementations

impl<A> Clone for Queue<A>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<A> IntoIterator for Queue<A>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<'a, A> IntoIterator for &'a Queue<A>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<A, T> FromIterator<T> for Queue<A> where
    Arc<A>: From<T>, 
[src]

Creates a value from an iterator. Read more