Skip to main content

TreeDisplay

Trait TreeDisplay 

Source
pub trait TreeDisplay {
    // Required method
    fn tree_print(&self, f: &mut Formatter<'_>, depth: TreeState) -> Result;

    // Provided methods
    fn display_tree(&self, f: &mut Formatter<'_>) -> Result { ... }
    fn debug_tree(&self, f: &mut Formatter<'_>) -> Result { ... }
    fn write_tree(&self, f: &mut impl Write) -> Result<()> { ... }
}
Expand description

Trait for displaying a tree

Required Methods§

Source

fn tree_print(&self, f: &mut Formatter<'_>, depth: TreeState) -> Result

Write item into f and use {:depth$} syntax in front of your single line output to get proper indention.

Provided Methods§

Source

fn display_tree(&self, f: &mut Formatter<'_>) -> Result

Display as tree starting at depth 0.

Source

fn debug_tree(&self, f: &mut Formatter<'_>) -> Result

Display as tree starting at given depth in debug mode

Source

fn write_tree(&self, f: &mut impl Write) -> Result<()>

Display as tree starting at depth 0 into a file

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§