TreeDisplay

Trait TreeDisplay 

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

    // Provided methods
    fn print_tree(&self, f: &mut Formatter<'_>, shorten: bool) -> 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 print_tree(&self, f: &mut Formatter<'_>, shorten: bool) -> Result

Display as tree starting at depth 0.

Source

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

Display as tree starting at depth 0.

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§

Source§

impl TreeDisplay for ArrayExpressionInner

Source§

impl TreeDisplay for Expression

Source§

impl TreeDisplay for Literal

Source§

impl TreeDisplay for Unit

Source§

impl TreeDisplay for Statement

Source§

impl TreeDisplay for UseDeclaration

Source§

impl TreeDisplay for Value

Source§

impl TreeDisplay for Attributes

Source§

impl TreeDisplay for Models

Source§

impl TreeDisplay for Properties

Source§

impl TreeDisplay for Model

Source§

impl TreeDisplay for Assignment

Source§

impl TreeDisplay for Attribute

Source§

impl TreeDisplay for Body

Source§

impl TreeDisplay for Argument

Source§

impl TreeDisplay for ArgumentList

Source§

impl TreeDisplay for Call

Source§

impl TreeDisplay for MethodCall

Source§

impl TreeDisplay for DocBlock

Source§

impl TreeDisplay for ArrayExpression

Source§

impl TreeDisplay for Marker

Source§

impl TreeDisplay for RangeExpression

Source§

impl TreeDisplay for RangeFirst

Source§

impl TreeDisplay for RangeLast

Source§

impl TreeDisplay for TupleExpression

Source§

impl TreeDisplay for FormatExpression

Source§

impl TreeDisplay for FormatSpec

Source§

impl TreeDisplay for FormatString

Source§

impl TreeDisplay for FunctionDefinition

Source§

impl TreeDisplay for FunctionSignature

Source§

impl TreeDisplay for Identifier

Source§

impl TreeDisplay for QualifiedName

Source§

impl TreeDisplay for InitDefinition

Source§

impl TreeDisplay for ModuleDefinition

Source§

impl TreeDisplay for Parameter

Source§

impl TreeDisplay for ParameterList

Source§

impl TreeDisplay for SourceFile

Source§

impl TreeDisplay for AssignmentStatement

Source§

impl TreeDisplay for ExpressionStatement

Source§

impl TreeDisplay for IfStatement

Source§

impl TreeDisplay for ReturnStatement

Source§

impl TreeDisplay for TypeAnnotation

Source§

impl TreeDisplay for UseStatement

Source§

impl TreeDisplay for WorkbenchDefinition