StandardDecorator

Struct StandardDecorator 

Source
pub struct StandardDecorator { /* private fields */ }
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

§Dashed

No effect: Style::last


  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§

Source§

impl StandardDecorator

Source

pub fn new(block_len: usize) -> Self

Trait Implementations§

Source§

impl Decorator for StandardDecorator

Source§

fn block_length(&self) -> usize

Single block length. Read more
Source§

fn item(&self, level: u32, style: &Style) -> &str

Item matching provided Style. Read more
Source§

fn previous_item_block(&self, level: u32, style: &Style) -> &str

Previous block matching provided Style. Read more
Source§

impl Default for StandardDecorator

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.