[][src]Struct text_trees::TreeFormatting

pub struct TreeFormatting {
    pub prefix_str: Option<String>,
    pub orientation: TreeOrientation,
    pub anchor: AnchorPosition,
    pub chars: FormatCharacters,
}

This structure collects together all the formatting options that control how the tree is output.

Fields

prefix_str: Option<String>

A prefix string written before every line. While no validation is performed on this value, if newline (or other formatting) characters are included the tree is likely to appear disjointed.

orientation: TreeOrientation

The orientation to write the tree.

anchor: AnchorPosition

The line anchor position.

chars: FormatCharacters

The set of characters to use when line formatting.

Implementations

impl TreeFormatting[src]

pub fn dir_tree(chars: FormatCharacters) -> Self[src]

Construct the common options for a directory tree using the provided format characters.

pub fn dir_tree_with_prefix(chars: FormatCharacters, prefix_str: String) -> Self[src]

Construct the common options for a directory tree using the provided format characters. Additionally, the value for prefix_str will be used for each output line.

pub fn dir_tree_left(chars: FormatCharacters) -> Self[src]

Construct the common options for a directory tree, with lines anchored to the left, using the provided format characters.

pub fn dir_tree_left_with_prefix(
    chars: FormatCharacters,
    prefix_str: String
) -> Self
[src]

Construct the common options for a directory tree, with lines anchored to the left, using the provided format characters. Additionally, the value for prefix_str will be used for each output line.

Trait Implementations

impl Clone for TreeFormatting[src]

impl Debug for TreeFormatting[src]

impl Default for TreeFormatting[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.