Struct woodland::binary_tree::BinaryTreeNode [−][src]
pub struct BinaryTreeNode<T> { /* fields omitted */ }
Expand description
The most simple node type in woodland
. Stores a data field, a NodeId
, as well as a left
and right
child.
All get’s and set’s are implemented via the NodeOperations
and BinaryNodeOperations
traits.
Notice that there is no way to create a BinaryTreeNode
explicitly, as all nodes must be created by
the corresponding tree’s memory arena. To learn more about memory arena’s and the
implementation of tree’s in woodland
, refer to the documentation home page.
Trait Implementations
impl<T> BinaryNodeOperations for BinaryTreeNode<T>
[src]
impl<T> BinaryNodeOperations for BinaryTreeNode<T>
[src]impl<T: Debug> Debug for BinaryTreeNode<T>
[src]
impl<T: Debug> Debug for BinaryTreeNode<T>
[src]impl<T: Hash> Hash for BinaryTreeNode<T>
[src]
impl<T: Hash> Hash for BinaryTreeNode<T>
[src]impl<'a, T> IterativeTreeOperations<BinaryTreeNode<T>> for BinaryTree<T> where
T: Hash,
T: Eq,
T: PartialEq,
[src]
impl<'a, T> IterativeTreeOperations<BinaryTreeNode<T>> for BinaryTree<T> where
T: Hash,
T: Eq,
T: PartialEq,
[src]fn preorder_iter(&self) -> Box<dyn Iterator<Item = &BinaryTreeNode<T>>>
[src]
fn preorder_iter(&self) -> Box<dyn Iterator<Item = &BinaryTreeNode<T>>>
[src]Get a preorder traveral iterator.
fn inorder_iter(&self) -> Box<dyn Iterator<Item = &BinaryTreeNode<T>>>
[src]
fn inorder_iter(&self) -> Box<dyn Iterator<Item = &BinaryTreeNode<T>>>
[src]Get an inorder traversal iterator.
fn postorder_iter(&self) -> Box<dyn Iterator<Item = &BinaryTreeNode<T>>>
[src]
fn postorder_iter(&self) -> Box<dyn Iterator<Item = &BinaryTreeNode<T>>>
[src]Get a postorder traversal iterator.
impl<T> NodeOperations for BinaryTreeNode<T>
[src]
impl<T> NodeOperations for BinaryTreeNode<T>
[src]type T = T
fn get_data_mut(&mut self) -> &mut T
[src]
fn get_data_mut(&mut self) -> &mut T
[src]Get a mutable reference to the data inside the node
impl<T: PartialEq> PartialEq<BinaryTreeNode<T>> for BinaryTreeNode<T>
[src]
impl<T: PartialEq> PartialEq<BinaryTreeNode<T>> for BinaryTreeNode<T>
[src]fn eq(&self, other: &BinaryTreeNode<T>) -> bool
[src]
fn eq(&self, other: &BinaryTreeNode<T>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &BinaryTreeNode<T>) -> bool
[src]
fn ne(&self, other: &BinaryTreeNode<T>) -> bool
[src]This method tests for !=
.
impl<T> TreeOperations<BinaryTreeNode<T>> for BinaryTree<T> where
T: Hash,
T: Eq,
T: PartialEq,
[src]
impl<T> TreeOperations<BinaryTreeNode<T>> for BinaryTree<T> where
T: Hash,
T: Eq,
T: PartialEq,
[src]fn create_node(&mut self, data: T) -> NodeId
[src]
fn create_node(&mut self, data: T) -> NodeId
[src]Genereate a new mutable reference to a NodeType. You must call this function to get new references since we are allocating all references in the Arena. Read more
fn is_empty(&self) -> bool
[src]
fn is_empty(&self) -> bool
[src]Returns true
if there are no nodes in the tree, and returns false
otherwise.
fn get_node(&self, node_id: NodeId) -> Option<&BinaryTreeNode<T>>
[src]
fn get_node(&self, node_id: NodeId) -> Option<&BinaryTreeNode<T>>
[src]Get a refrence to a NodeType<T>
from a given NodeId
, if a node with the specified
NodeId
exists in the tree. Read more
fn get_node_mut(&mut self, node_id: NodeId) -> Option<&mut BinaryTreeNode<T>>
[src]
fn get_node_mut(&mut self, node_id: NodeId) -> Option<&mut BinaryTreeNode<T>>
[src]Get a mutable reference to a NodeType<T>
from a given NodeId
, if a node with the
specified NodeId
exists in the tree. Read more
impl<T: Eq> Eq for BinaryTreeNode<T>
[src]
impl<T> StructuralEq for BinaryTreeNode<T>
[src]
impl<T> StructuralPartialEq for BinaryTreeNode<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for BinaryTreeNode<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for BinaryTreeNode<T> where
T: Send,
T: Send,
impl<T> Sync for BinaryTreeNode<T> where
T: Sync,
T: Sync,
impl<T> Unpin for BinaryTreeNode<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for BinaryTreeNode<T> where
T: UnwindSafe,
T: UnwindSafe,