Struct cons_list::ConsList [] [src]

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

An immutable singly-linked list, as seen in basically every functional language

Methods

impl<T> ConsList<T>
[src]

Constructs a new, empty ConsList

Returns a copy of the list, with elem appended to the front

Returns a reference to the first element in the list

Returns a copy of the list, with the first element removed

Returns a copy of the list, with the first n elements removed

Returns the last element in the list

Returns a copy of the list, with only the last n elements remaining

Returns an iterator over references to the elements of the list in order

Trait Implementations

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

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

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

Creates a value from an iterator. Read more

impl<T: PartialEq> PartialEq for ConsList<T>
[src]

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

This method tests for !=.

impl<T: PartialOrd> PartialOrd for ConsList<T>
[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<T> Clone for ConsList<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Formats the value using the given formatter.

impl<A: Hash> Hash for ConsList<A>
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl<'a, T> IntoIterator for &'a ConsList<T>
[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