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]

[src]

Construct an empty queue.

[src]

Construct a queue by consuming an IntoIterator.

Allows you to construct a queue out of anything that implements the IntoIterator trait.

Time: O(n)

[src]

Test whether a queue is empty.

Time: O(1)

[src]

Get the length of a queue.

Time: O(1)

[src]

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

Time: O(1)

[src]

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.

[src]

Get an iterator over a queue.

Trait Implementations

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<A> Debug for Queue<A> where
    A: Debug
[src]

[src]

Formats the value using the given formatter.

impl<A: PartialEq> PartialEq for Queue<A>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<A: Eq> Eq for Queue<A>
[src]

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

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

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?

[src]

Creates an iterator from a value. Read more

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

[src]

Creates a value from an iterator. Read more

impl<'a, A, T> From<&'a [T]> for Queue<A> where
    &'a T: Shared<A>, 
[src]

[src]

Performs the conversion.

impl<A, T> From<Vec<T>> for Queue<A> where
    T: Shared<A>, 
[src]

[src]

Performs the conversion.

impl<'a, A, T> From<&'a Vec<T>> for Queue<A> where
    &'a T: Shared<A>, 
[src]

[src]

Performs the conversion.