Struct fwdlist::List [] [src]

pub struct List<T> { /* fields omitted */ }

A simply linked list.

Methods

impl<T> List<T>
[src]

A new empty list.

The size of the list in O(1).

Returns true if list is empty in O(1);

Push a new element at the front of the list in O(1). Cannot fails, only panic!/OOM on memory exhaustion.

Pop a element from the front of the list in O(1). Returns None if the list is empty.

Push an element at the end of the list in O(n). Cannot fails, only panic!/OOM on memory exhaustion.

Pop an element from the end of the list in O(n). Returns None if the list is empty.

Clear the list in O(n).

impl<T> List<T>
[src]

Some accessors to front/back elements.

Returns a reference to the first element in the list.

Returns a mutable reference to the first element in the list.

Returns a reference to the last element in the list.

Returns a mutable reference to the last element in the list.

impl<T> List<T>
[src]

Extra operations on the list - Unstable API.

Moves all elements from other to the end of the list in O(self.len());

Splits the list into two at the given index in O(at).

  • Returns everything after the given index, including the index.
  • if at == self.len(), returns an empty list in O(1).
  • Panics if at > self.len().

impl<T> List<T>
[src]

Returns an iterator over the list yielding read-only references.

impl<T> List<T>
[src]

Returns an iterator over the list yielding mutable references.

impl<T> List<T>
[src]

Return a cursor at the beginning of the list (before the first node).

Trait Implementations

impl<T> Drop for List<T>
[src]

Drop the list in O(n).

A method called when the value goes out of scope. Read more

impl<T> Default for List<T>
[src]

A default empty list.

Returns the "default value" for a type. Read more

impl<T: Debug> Debug for List<T>
[src]

A debug formatter.

Formats the value using the given formatter.

impl<T: Clone> Clone for List<T>
[src]

Clone a list in O(n).

clone_from() will reuse as many nodes from self as possible to avoid reallocation.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> FromIterator<T> for List<T>
[src]

Construct a list from the content of the iterator iter in O(n).

Creates a value from an iterator. Read more

impl<T> Extend<T> for List<T>
[src]

Extend the list from the content of iter in O(n).

Extends a collection with the contents of an iterator. Read more

impl<T: Hash> Hash for List<T>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

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

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

This method tests for !=.

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

impl<A: PartialOrd> PartialOrd for List<A>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<A: Ord> Ord for List<A>
[src]

This method returns an Ordering between self and other. Read more

impl<T> IntoIterator for List<T>
[src]

for v in my_list { v ... }

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> IntoIterator for &'a List<T>
[src]

for v in &my_list { *v ... }

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> IntoIterator for &'a mut List<T>
[src]

for v in &mut my_list { *v = ... }

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