pub struct NavCursorMut<'a, K, V, S, A, P>where
P: TreePolicy<K = K, V = V, S = S>,
A: Allocator,{ /* private fields */ }Expand description
A mutable navigation cursor for an augmented Red-Black tree layout.
NavCursorMut provides a stateful, bidirectionally navigable handle over the tree nodes.
It uniquely allows for read-only key access, read-only tree statistics access,
and mutable value adjustments via a specialized internal RAII guard (crate::NodeGuard).
Because values can be modified mutably through this cursor, any mutations that alter secondary tree properties will trigger the augmentation.
§Lifetime Architecture
'a- Binds the exclusive mutable borrow of the underlying tree structural layout. This ensures that the tree cannot be mutated or invalidated by other access vectors while the cursor is actively operating.
Implementations§
Sourcepub fn get(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn get(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Returns a tuple containing an immutable reference to the key, a mutable value guard, and an immutable reference to the statistics of the current node.
Returns None if the cursor is invalid or exhausted.
Sourcepub fn peek_next(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn peek_next(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Peeks forward to the next in-order node’s data without moving the cursor’s position.
Returns None if there is no subsequent in-order node.
Sourcepub fn peek_prev(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn peek_prev(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Peeks backward to the previous in-order node’s data without moving the cursor’s position.
Returns None if there is no prior in-order node.
Sourcepub fn peek_parent(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn peek_parent(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Peeks upward to the parent node’s data without moving the cursor’s position.
Returns None if the cursor is at the root of the tree.
Sourcepub fn peek_left(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn peek_left(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Peeks downward to the left child node’s data without moving the cursor’s position.
Returns None if there is no left child.
Sourcepub fn peek_right(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn peek_right(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Peeks downward to the right child node’s data without moving the cursor’s position.
Returns None if there is no right child.
Sourcepub fn next(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn next(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Moves the cursor to the next sequential node in-order and returns its data components.
If no subsequent node exists, the cursor is advanced to an empty (None) state.
Sourcepub fn prev(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn prev(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Moves the cursor to the previous sequential node in-order and returns its data components.
If no prior node exists, the cursor is advanced to an empty (None) state.
Sourcepub fn parent(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn parent(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Moves the cursor up to the parent node and returns its data components.
Returns None and leaves the cursor unchanged if no parent exists.
Sourcepub fn left(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn left(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Moves the cursor down into the left child node and returns its data components.
Returns None and leaves the cursor unchanged if no left child exists.
Sourcepub fn right(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
pub fn right(&mut self) -> Option<NodeGuard<'_, K, V, S, P>>
Moves the cursor down into the right child node and returns its data components.
Returns None and leaves the cursor unchanged if no right child exists.
Sourcepub fn remove(&mut self) -> Option<(K, V)>
pub fn remove(&mut self) -> Option<(K, V)>
Removes the node currently pointed to by the cursor from the tree structure, returning its owned key and value coordinates.
This operation triggers full internal Red-Black tree rebalancing and augmented stat updates along the tree lineage.
Returns None if the cursor is already empty or invalid.