Struct intrusive_collections::singly_linked_list::SinglyLinkedList [] [src]

pub struct SinglyLinkedList<A: Adaptor<Link>> { /* fields omitted */ }

An intrusive doubly-linked list.

Methods

impl<A: Adaptor<Link>> SinglyLinkedList<A>
[src]

Creates an empty SinglyLinkedList.

Returns true if theSinglyLinkedList` is empty.

Returns a null Cursor for this list.

Returns a null CursorMut for this list.

Creates a Cursor from a pointer to an element.

Safety

ptr must be a pointer to an object that is part of this list.

Creates a CursorMut from a pointer to an element.

Safety

ptr must be a pointer to an object that is part of this list.

Returns a Cursor pointing to the first element of the list. If the list is empty then a null cursor is returned.

Returns a CursorMut pointing to the first element of the list. If the the list is empty then a null cursor is returned.

Gets an iterator over the objects in the SinglyLinkedList.

Calls the given function for each element in the SinglyLinkedList before removing it from the list.

This will unlink all objects currently in the list.

If the given function panics then all elements in the SinglyLinkedList will still be unlinked, but the function will not be called for any elements after the one that panicked.

Removes all elements from the SinglyLinkedList.

This will unlink all object currently in the list, which requires iterating through all elements in the SinglyLinkedList.

Empties the SinglyLinkedList without unlinking objects in it.

Since this does not unlink any objects, any attempts to link these objects into another SinglyLinkedList will fail but will not cause any memory unsafety. To unlink those objects manually, you must call the unsafe_unlink function on them.

This is the only function that can be safely called after an object has been moved or dropped while still being linked into this SinglyLinkedList.

Takes all the elements out of the SinglyLinkedList, leaving it empty. The taken elements are returned as a new SinglyLinkedList.

Inserts a new element at the start of the SinglyLinkedList.

Removes the first element of the SinglyLinkedList.

This returns None if the SinglyLinkedList is empty.

Trait Implementations

impl<A: Adaptor<Link> + Sync> Sync for SinglyLinkedList<A> where A::Container: Sync
[src]

impl<A: Adaptor<Link> + Send> Send for SinglyLinkedList<A> where A::Container: Send + Sync
[src]

impl<'a, A: Adaptor<Link> + 'a> IntoIterator for &'a SinglyLinkedList<A>
[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

impl<A: Adaptor<Link> + Default> Default for SinglyLinkedList<A>
[src]

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

impl<A: Adaptor<Link>> Debug for SinglyLinkedList<A> where A::Container: Debug
[src]

Formats the value using the given formatter.