Node

Trait Node 

Source
pub trait Node: Sized {
    type Key: Ord + Debug;
    type Ptr: NodePtr<Self>;

    // Required methods
    fn new(node: &Self) -> Self::Ptr;
    fn free(&mut self);
    fn left(&self) -> &Self::Ptr;
    fn left_mut(&mut self) -> &mut Self::Ptr;
    fn right(&self) -> &Self::Ptr;
    fn right_mut(&mut self) -> &mut Self::Ptr;
    fn key(&self) -> &Self::Key;
    fn update(&mut self, node: &Self);
    fn is_black(&self) -> bool;
    fn set_black(&mut self);
    fn set_red(&mut self);

    // Provided method
    fn is_red(&self) -> bool { ... }
}

Required Associated Types§

Source

type Key: Ord + Debug

Source

type Ptr: NodePtr<Self>

Required Methods§

Source

fn new(node: &Self) -> Self::Ptr

Source

fn free(&mut self)

Source

fn left(&self) -> &Self::Ptr

Source

fn left_mut(&mut self) -> &mut Self::Ptr

Source

fn right(&self) -> &Self::Ptr

Source

fn right_mut(&mut self) -> &mut Self::Ptr

Source

fn key(&self) -> &Self::Key

Source

fn update(&mut self, node: &Self)

Source

fn is_black(&self) -> bool

Source

fn set_black(&mut self)

Source

fn set_red(&mut self)

Provided Methods§

Source

fn is_red(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§