bin_tree/node.rs
1/// A trait representing a node in a binary tree.
2pub trait Node {
3 /// Creates a new parent node from two child nodes
4 ///
5 /// # Arguments
6 ///
7 /// * `right` - the right child node
8 ///
9 /// # Return
10 ///
11 /// The new parent node with the left node as `self` and the right node as `right`
12 fn new_parent(self, right: Self) -> Self;
13 /// Creates a new parent node from a single child node
14 ///
15 /// # Return
16 ///
17 /// The new parent node with the child node as `self`
18 fn new_parent_from_single(self) -> Self;
19}