pub struct List<T: ?Sized> { /* private fields */ }
Expand description

An intrusive doubly-linked list.

This data structure may be used as a first-in, first-out queue by using the List::push_front and List::pop_back methods. It also supports random-access removals using the List::remove method.

In order to be part of a List, a type T must implement Linked for list::Links<T>.

Implementations

Returns a new empty list.

Returns true if this list is empty.

Asserts as many of the linked list’s invariants as possible.

Appends an item to the head of the list.

Removes an item from the tail of the list.

Remove an arbitrary node from the list.

Safety

The caller must ensure that the removed node is an element of this linked list, and not any other linked list.

Returns a Cursor over the items in this list.

The Cursor type can be used as a mutable Iterator. In addition, however, it also permits modifying the structure of the list by inserting or removing elements at the cursor’s current position.

Returns an iterator over the items in this list, by reference.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.