pub struct Style {
pub char_set: CharSet,
pub indentation: u32,
pub leaf_style: TextStyle,
pub branch_style: TextStyle,
}
Expand description
A type that describes the way a type that implements DisplayTree
should
be formatted.
Prefer using builder methods, either on Style
or AsTree
, over
constructing an instance of Style
manually.
Note: StyleBuilder
must be in scope to use builder methods.
§Examples
use display_tree::{CharSet, Color, Style, StyleBuilder};
let style = Style::default()
.leaf_color(Color::Blue)
.branch_background_color(Color::Red)
.indentation(4)
.char_set(CharSet::SINGLE_LINE_CURVED);
Fields§
§char_set: CharSet
The CharSet
making up the branches of the tree.
indentation: u32
The indentation of each node.
leaf_style: TextStyle
The style of the leaves of the tree. See TextStyle
for more
information.
branch_style: TextStyle
The style of the branches of the tree. See TextStyle
for more
information.
Trait Implementations§
Source§impl Default for Style
impl Default for Style
Source§impl StyleBuilder for Style
impl StyleBuilder for Style
Source§fn indentation(self, indentation: u32) -> Self
fn indentation(self, indentation: u32) -> Self
Sets the indentation of each node. Read more
Source§fn leaf_style(self, style: TextStyle) -> Self
fn leaf_style(self, style: TextStyle) -> Self
Sets the style of the leaves of the tree. See
TextStyle
for more
information.Source§fn branch_style(self, style: TextStyle) -> Self
fn branch_style(self, style: TextStyle) -> Self
Sets the style of the branches of the tre. See
TextStyle
for more
information.Source§fn leaf_color(self, color: Color) -> Self
fn leaf_color(self, color: Color) -> Self
Sets the color of the leaves of the tree. See
Color
for more
information.Source§fn leaf_background_color(self, color: Color) -> Self
fn leaf_background_color(self, color: Color) -> Self
Sets the background color of the leaves of the tree. See
Color
for
more information.Source§fn bold_leaves(self) -> Self
fn bold_leaves(self) -> Self
Renders the leaves as bold.
Source§fn faint_leaves(self) -> Self
fn faint_leaves(self) -> Self
Decreases the intensity of the leaves.
Source§fn italic_leaves(self) -> Self
fn italic_leaves(self) -> Self
Italicises the leaves.
Source§fn underlined_leaves(self) -> Self
fn underlined_leaves(self) -> Self
Underlines the leaves.
Source§fn strikethrough_leaves(self) -> Self
fn strikethrough_leaves(self) -> Self
Causes the leaves to be crossed-out.
Source§fn branch_color(self, color: Color) -> Self
fn branch_color(self, color: Color) -> Self
Sets the color of the branches of the tree. See
Color
for more
information.Source§fn branch_background_color(self, color: Color) -> Self
fn branch_background_color(self, color: Color) -> Self
Sets the background color of the branches of the tree. See
Color
for
more information.Source§fn bold_branches(self) -> Self
fn bold_branches(self) -> Self
Renders the branches as bold.
Source§fn faint_branches(self) -> Self
fn faint_branches(self) -> Self
Decreases the intensity of the branches.
impl Copy for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnwindSafe for Style
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more