pub struct Cursor<'a, K, N, M> { /* private fields */ }Expand description
A cursor over a KeyNodeList.
Implementations§
Source§impl<'a, K, N, M> Cursor<'a, K, N, M>
impl<'a, K, N, M> Cursor<'a, K, N, M>
Sourcepub fn key(&self) -> Option<&K>
pub fn key(&self) -> Option<&K>
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.
Source§impl<'a, K, N, M> Cursor<'a, K, N, M>
impl<'a, K, N, M> Cursor<'a, K, N, M>
Sourcepub fn node(&self) -> Option<&N>
pub fn node(&self) -> Option<&N>
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.
Sourcepub fn front_node(&self) -> Option<&N>
pub fn front_node(&self) -> Option<&N>
Provides a reference to the front node of the cursor’s parent list,
or None if the list is empty.
Source§impl<'a, K, N, M> Cursor<'a, K, N, M>
impl<'a, K, N, M> Cursor<'a, K, N, M>
Sourcepub fn next_key(&self) -> Option<&K>
pub fn next_key(&self) -> Option<&K>
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.
Sourcepub fn prev_key(&self) -> Option<&K>
pub fn prev_key(&self) -> Option<&K>
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.
Sourcepub fn next_node(&self) -> Option<&N>
pub fn next_node(&self) -> Option<&N>
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.
Sourcepub fn prev_node(&self) -> Option<&N>
pub fn prev_node(&self) -> Option<&N>
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.
Source§impl<'a, K, N, M> Cursor<'a, K, N, M>
impl<'a, K, N, M> Cursor<'a, K, N, M>
Sourcepub fn move_next(&mut self)
pub fn move_next(&mut self)
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.
Sourcepub fn move_prev(&mut self)
pub fn move_prev(&mut self)
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.