Expand description
This module implements a specialized linked list.
The implemented list (from now on called a tail list) is neither a singly nor doubly linked: aside from the optional link to the next node, each node also has reference to the link which owns the node.
For each tail list there is one item which currently ‘owns’ a node and it’s tail (all the following nodes). ‘Owns’ in this context does not mean actual ownership in rust terms, but rather ‘mutably borrows’ this node (and it’s) tail. This item will be referred to as the active item.
For each node which is not owned by the currently active item, there exists at most one passive item, which owns a single node, but neither it’s predecessors nor successors.
A TailList
, Cursor
and TailValRef
are active items. A ValRef
is a
passive item.
An active item may temporarily transfer ownership of it’s owned node to another item by creating a mutable borrow to itself.
Structs§
- Cursor
- A
Cursor
is an iterator over a node and it’s tail. It is an active item, which owns the next node it would return. - Tail
List - A specialized linked list (see the module documentation).
- Tail
ValRef - A
TailValRef
is an active item, which provides mutable access to a single node and its successors. - ValRef
- A
ValRef
is a passive item, which provides mutable access to a single node.