pub struct Node<T> {
pub t: T,
/* private fields */
}Expand description
A node in a RedBlackTree.
The only publically available field is the contained value t, which can also be obtained through val().
Node<T> implements Deref<Target = T>, so you can use &Node<T> in place of &T through deref-coercion.
Fields§
§t: TThe value contained in the Node.
Implementations§
Source§impl<T> Node<T>
impl<T> Node<T>
Sourcepub fn min(&self) -> &Node<T>
pub fn min(&self) -> &Node<T>
Returns the minimum value in this subtree.
This operation is O(log n).
Sourcepub fn max(&self) -> &Node<T>
pub fn max(&self) -> &Node<T>
Returns the maximum value in this subtree.
This operation is O(log n).
Sourcepub fn predecessor(&self) -> Option<&Node<T>>
pub fn predecessor(&self) -> Option<&Node<T>>
Returns the predecessor node, which is the previous in-order node and is not necessarily within the sub-tree defined by the current node.
This operation is at-worst O(log n).
Sourcepub fn successor(&self) -> Option<&Node<T>>
pub fn successor(&self) -> Option<&Node<T>>
Returns the successor node, which is the previous in-order node and is not necessarily within the sub-tree defined by the current node.
This operation is at-worst O(log n).
Trait Implementations§
impl<T: Eq> Eq for Node<T>
Source§impl<'a, T> IntoIterator for &'a Node<T>
impl<'a, T> IntoIterator for &'a Node<T>
Source§impl<T: Ord> Ord for Node<T>
impl<T: Ord> Ord for Node<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: Ord> PartialOrd for Node<T>
impl<T: Ord> PartialOrd for Node<T>
Auto Trait Implementations§
impl<T> !Send for Node<T>
impl<T> !Sync for Node<T>
impl<T> Freeze for Node<T>where
T: Freeze,
impl<T> RefUnwindSafe for Node<T>where
T: RefUnwindSafe,
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> UnsafeUnpin for Node<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Node<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more