pub trait AsTree {
// Required method
fn _get_tree(&self, bits: &mut Vec<bool>) -> String;
// Provided methods
fn get_tree(&self) -> String { ... }
fn _get_indent(&self, bits: Vec<bool>) -> String { ... }
fn _get_intermediate(&self) -> String { ... }
fn _get_end(&self) -> String { ... }
}
Expand description
This trait defines some simple methods for pretty-printing tree-like structures.
Required Methods§
Provided Methods§
Sourcefn get_tree(&self) -> String
fn get_tree(&self) -> String
Returns a string representing the node and its children with tree formatting.
Sourcefn _get_indent(&self, bits: Vec<bool>) -> String
fn _get_indent(&self, bits: Vec<bool>) -> String
Returns a string with the proper indents for a given entry in
AsTree::get_tree
. A true
bit will yield a vertical line, while a
false
bit will not.
Sourcefn _get_intermediate(&self) -> String
fn _get_intermediate(&self) -> String
Returns a string with the intermediate branch symbol for a given entry in
AsTree::get_tree
.
Sourcefn _get_end(&self) -> String
fn _get_end(&self) -> String
Prints the a final branch for a given entry in AsTree::get_tree
.