Struct key_node_list::CursorMut [−][src]
pub struct CursorMut<'a, K, N, M> { /* fields omitted */ }Expand description
A cursor over a KeyNodeList with editing operations.
Implementations
Returns a reference to the key that the cursor is currently pointing to.
Returns None if the cursor is currently pointing to the null pair.
Provides a reference to the front key of the cursor’s parent list,
or None if the list is empty.
Returns a reference to the node that the cursor is currently pointing to.
Returns None if the cursor is currently pointing to the null pair.
Provides a reference to the front node of the cursor’s parent list,
or None if the list is empty.
Returns a reference to the next key.
If the cursor is pointing to the null pair then this returns the first
key of the KeyNodeList. If it is pointing to the last key of the
KeyNodeList then this returns None.
Returns a reference to the previous key.
If the cursor is pointing to the null pair then this returns the last
key of the KeyNodeList. If it is pointing to the first key of the
KeyNodeList then this returns None.
Returns a reference to the next node.
If the cursor is pointing to the null pair then this returns the first
node of the KeyNodeList. If it is pointing to the last node of the
KeyNodeList then this returns None.
Returns a reference to the previous node.
If the cursor is pointing to the null pair then this returns the last
node of the KeyNodeList. If it is pointing to the first node of the
KeyNodeList then this returns None.
Moves the cursor to the next key-node pair of the KeyNodeList.
If the cursor is pointing to the null pair then this will move it to
the first key-node pair of the KeyNodeList. If it is pointing to
the last key-node pair of the KeyNodeList then this will move it
to the null pair.
Moves the cursor to the previous key-node pair of the KeyNodeList.
If the cursor is pointing to the null pair then this will move it to
the last key-node pair of the KeyNodeList. If it is pointing to
the first key-node pair of the KeyNodeList then this will move it
to the null pair.
Returns a mutable reference to the node that the cursor is currently pointing to.
Returns None if the cursor is currently pointing to the null pair.
Provides a mutable reference to the front node of the cursor’s parent
list, or None if the list is empty.
Provides a mutable reference to the back node of the cursor’s parent
list, or None if the list is empty.
Inserts a new key-node pair into the KeyNodeList after the current one.
If the cursor is pointing at the null pair then the new pair is inserted
at the front of the KeyNodeList.
If key already exists, returns an error containing key and node.
Inserts a new key-node pair into the KeyNodeList before the current one.
If the cursor is pointing at the null pair then the new pair is inserted
at the end of the KeyNodeList.
If key already exists, returns an error containing key and node.
Inserts a key into the KeyNodeList after the current one.
If the cursor is pointing at the null pair then the key is inserted
at the front of the KeyNodeList.
If key already exists, returns an error containing key.
Inserts a key into the KeyNodeList before the current one.
If the cursor is pointing at the null pair then the key is inserted
at the front of the KeyNodeList.
If key already exists, returns an error containing key.
Removes the current pair from the KeyNodeList.
The pair that was removed is returned, and the cursor is moved to point
to the next pair in the KeyNodeList.
If the cursor is currently pointing to the null pair then no pair is
removed and None is returned.
Appends an pair to the front of the cursor’s parent list. The pair that the cursor points to is unchanged, even if it is the null pair.
If key already exists, returns an error containing key and node.
This operation should compute in O(1) time on average.
Appends an pair to the back of the cursor’s parent list. The pair that the cursor points to is unchanged, even if it is the null pair.
If key already exists, returns an error containing key and node.
This operation should compute in O(1) time on average.
Removes the first pair from the cursor’s parent list and returns it, or
None if the list is empty. The pair the cursor points to remains
unchanged, unless it was pointing to the front pair. In that case, it
points to the new front pair.
This operation should compute in O(1) time on average.
Removes the last pair from the cursor’s parent list and returns it, or
None if the list is empty. The pair the cursor points to remains
unchanged, unless it was pointing to the back pair. In that case, it
points to the null pair.
This operation should compute in O(1) time on average.
