Trait Node

Source
pub trait Node<T> {
Show 25 methods // Required methods fn get_value(&self) -> &T; fn get(&self, i: usize) -> &Self; fn get_mut(&self, i: usize) -> &mut Self; fn location(&self) -> usize; fn get_parent(&self) -> Option<usize>; fn set_parent(&mut self, p: Option<usize>); fn get_child(&self, side: Side) -> Option<usize>; fn set_child(&mut self, child: usize, side: Side); fn set_child_opt(&mut self, child: Option<usize>, side: Side); fn to_self_string(&self) -> String; fn to_self_string_display(&self) -> (String, usize); fn is(&self, val: &T) -> bool; fn greater(&self, val: &T) -> bool; fn lesser(&self, val: &T) -> bool; // Provided methods fn to_string(&self) -> String { ... } fn to_pretty_string(&self, indent: usize) -> String { ... } fn get_height(&self) -> usize { ... } fn get_depth(&self) -> usize { ... } fn get_size(&self) -> usize { ... } fn get_leaf_count(&self) -> usize { ... } fn find_min(&self) -> usize { ... } fn side(&self) -> Side { ... } fn get_sibling(&self) -> Option<usize> { ... } fn get_uncle(&self) -> Option<usize> { ... } fn is_child(&self, side: Side) -> bool { ... }
}

Required Methods§

Source

fn get_value(&self) -> &T

Source

fn get(&self, i: usize) -> &Self

Source

fn get_mut(&self, i: usize) -> &mut Self

Source

fn location(&self) -> usize

Source

fn get_parent(&self) -> Option<usize>

Source

fn set_parent(&mut self, p: Option<usize>)

Source

fn get_child(&self, side: Side) -> Option<usize>

Source

fn set_child(&mut self, child: usize, side: Side)

Source

fn set_child_opt(&mut self, child: Option<usize>, side: Side)

Source

fn to_self_string(&self) -> String

Source

fn to_self_string_display(&self) -> (String, usize)

Source

fn is(&self, val: &T) -> bool

Source

fn greater(&self, val: &T) -> bool

Source

fn lesser(&self, val: &T) -> bool

Provided Methods§

Source

fn to_string(&self) -> String

Source

fn to_pretty_string(&self, indent: usize) -> String

Source

fn get_height(&self) -> usize

Source

fn get_depth(&self) -> usize

Source

fn get_size(&self) -> usize

Source

fn get_leaf_count(&self) -> usize

Source

fn find_min(&self) -> usize

Source

fn side(&self) -> Side

Source

fn get_sibling(&self) -> Option<usize>

Source

fn get_uncle(&self) -> Option<usize>

Source

fn is_child(&self, side: Side) -> 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§

Source§

impl<T: Debug + PartialOrd> Node<T> for AVLNode<T>

Source§

impl<T: Debug + PartialOrd> Node<T> for ColorNode<T>

Source§

impl<T: Debug + PartialOrd> Node<T> for RegularNode<T>