Trait rosary::tree_format::TreeFormat[][src]

pub trait TreeFormat {
    fn treeify(&self) -> RoseTree<String>;

    fn indent(&self) -> RoseTree<String> { ... }
fn fmt_tree(&self) -> String { ... } }

A trait which allows implementers to specify how they should be printed as a tree.

Required methods

fn treeify(&self) -> RoseTree<String>[src]

The only thing you need to define is the conversion from your type to a RoseTree.

Loading content...

Provided methods

fn indent(&self) -> RoseTree<String>[src]

Indent adds the decorations to the strings of the tree with the default formatter.

fn fmt_tree(&self) -> String[src]

Actually converts the tree into a single string for printing.

Loading content...

Trait Implementations

impl Display for dyn TreeFormat[src]

Implementors

impl<T: Display> TreeFormat for RoseTree<T>[src]

If you’re a RoseTree, you get TreeFormat for free so long as T can be printed. If printing T involves printing newlines, don’t. It’ll get weird.

Loading content...