Trait rosary::format::TreeFormat
source · pub trait TreeFormat {
// Required method
fn treeify(&self) -> RoseVecTree<String>;
// Provided methods
fn indent(&self) -> RoseVecTree<String> { ... }
fn fmt_tree(&self) -> String { ... }
}
Expand description
A trait which allows implementers to specify how they should be printed as a tree.
Required Methods§
sourcefn treeify(&self) -> RoseVecTree<String>
fn treeify(&self) -> RoseVecTree<String>
The only thing you need to define is the conversion from your type to a RoseVecTree.
Provided Methods§
sourcefn indent(&self) -> RoseVecTree<String>
fn indent(&self) -> RoseVecTree<String>
Indent adds the decorations to the strings of the tree with the default formatter.
Trait Implementations§
Implementors§
impl<T: Display> TreeFormat for RoseVecTree<T>
If you’re a RoseVecTree, you get TreeFormat for free so long as T can be printed. If printing T involves printing newlines, don’t. It’ll get weird.