Struct toolshed::list::List [] [src]

pub struct List<'arena, T: 'arena> { /* fields omitted */ }

A single-ended linked list.

Methods

impl<'arena, T: 'arena> List<'arena, T>
[src]

[src]

Create a new empty List.

[src]

Turns the list into an empty list.

Internally, all this method does is removing the reference to the first item on the list.

[src]

Returns an iterator over the items in the list.

[src]

Checks if the list is empty.

[src]

Returns the first element if, and only if, the list contains just that single element.

[src]

Returns the reference to the first element.

[src]

Returns an UnsafeList for the current List. While this function is safe itself, using UnsafeList might lead to undefined behavior.

impl<'arena, T: 'arena + Copy> List<'arena, T>
[src]

[src]

Create a single-element list from the given value.

[src]

Create a list from an iterator of items.

[src]

Adds a new element to the beginning of the list.

[src]

Removes the first element from the list and returns it.

[src]

Get the first element of the List, if any, then create a new List starting from the second element at the reference to the old list.

Note: This does not modify the internal state of the List. If you wish to modify the list use shift instead.

Trait Implementations

impl<'arena, T: Clone + 'arena> Clone for List<'arena, T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'arena, T: Copy> Copy for List<'arena, T>
[src]

impl<'arena, T: 'arena> IntoIterator for List<'arena, T>
[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, 'arena, T: 'arena> IntoIterator for &'a List<'arena, T>
[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, 'b, A, B> PartialEq<List<'b, B>> for List<'a, A> where
    A: PartialEq<B>, 
[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<'arena, T> Debug for List<'arena, T> where
    T: Debug
[src]

[src]

Formats the value using the given formatter.