Struct binary_tree::test::TestNode [] [src]

pub struct TestNode<T> {
    pub val: T,
    pub left: Option<Box<TestNode<T>>>,
    pub right: Option<Box<TestNode<T>>>,
}

A minimal Node implementation.

When should you use TestNode?

You should not use TestNode for anything, except may be to get to know what a binary tree is!

Fields

val
left
right

Methods

impl<T> TestNode<T>
[src]

fn new(val: T) -> TestNode<T>

Trait Implementations

impl<T> Node for TestNode<T>
[src]

type Value = T

fn left(&self) -> Option<&Self>

fn right(&self) -> Option<&Self>

fn value(&self) -> &T

fn walk<'a, F>(&'a self, step_in: F) where F: FnMut(&'a Self) -> WalkAction

impl<T> NodeMut for TestNode<T>
[src]

type NodePtr = Box<TestNode<T>>

fn detach_left(&mut self) -> Option<Self::NodePtr>

fn detach_right(&mut self) -> Option<Self::NodePtr>

fn insert_left(&mut self, st: Option<Self::NodePtr>) -> Option<Self::NodePtr>

fn insert_right(&mut self, st: Option<Self::NodePtr>) -> Option<Self::NodePtr>

fn value_mut(&mut self) -> &mut T

fn into_parts(self) -> (T, Option<Self::NodePtr>, Option<Self::NodePtr>)

fn left_mut(&mut self) -> Option<&mut Self>

fn right_mut(&mut self) -> Option<&mut Self>

fn rotate_left(&mut self) -> Result<(), ()>

fn rotate_right(&mut self) -> Result<(), ()>

fn walk_mut<'a, FI, FS>(&'a mut self, step_in: FI, stop: FS) where FI: FnMut(&Self) -> WalkAction, FS: FnOnce(&'a mut Self)

fn walk_reshape<FI, FS, FO>(&mut self, step_in: FI, stop: FS, step_out: FO) where FI: FnMut(&mut Self) -> WalkAction, FS: FnOnce(&mut Self), FO: FnMut(&mut Self, WalkAction)

fn insert_before<F>(&mut self, new_node: Self::NodePtr, step_out: F) where F: FnMut(&mut Self, WalkAction)

fn walk_extract<FI, FE, FO>(&mut self, step_in: FI, extract: FE, step_out: FO) -> Option<Self::NodePtr> where FI: FnMut(&mut Self) -> WalkAction, FE: FnOnce(&mut Self, &mut Option<Self::NodePtr>), FO: FnMut(&mut Self, WalkAction)

fn try_remove<F>(&mut self, step_out: F) -> Option<Self::NodePtr> where F: FnMut(&mut Self, WalkAction)

Derived Implementations

impl<T: Debug> Debug for TestNode<T>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result