Struct tree_decorator::StandardDecorator[][src]

pub struct StandardDecorator { /* fields omitted */ }
Expand description

Default decorator implementation.

Style

Root
├  Item A
│  Description
┊- Small Description
└  Item B
   ├  Item B.a
   ├  Item B.b
   │  └  Item B.b.a
   └  Item B.c

Uses a block length of 3 by default, but can be modified.

Block Level 0

At root item, nothing is rendered.

Block Level 1 or Greater

Every following section describes a style item available to use at styles section (at tree_item!).

Precedence

Some of them will takes precedence of others, such as Last and Dashed, meaning that, when both are opt-in together, it’ll use one which has the most precedence as guide to choose suitable item.

No Effect Combination

Also, there are combinations which has no effect, such as Last and Dashed, as well, they will have no effect by lack of proper character representation or the combination simply does’t makes sense.

When it occurs, it’ll effectively ignore the least preceding style.

Items

Last

No effect: Style::dashed

Takes precedence over: Style::dashed

Entry KindStyle::lastStyle::dashed
Entry::Simple
Entry::Double
Entry::None

Dashed

No effect: Style::last

Entry KindStyle::dashedStyle::last1
Entry::Simple┊-
Entry::Double┊=
Entry::None

  1. Style::last takes precedence here, as explained, so it’ll display as Style::dashed was ignored, as expected, since there is no available combination to both of them. 

Implementations

Trait Implementations

Single block length. Read more

Item matching provided Style. Read more

Previous block matching provided Style. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.