pub struct TreePresentation { /* private fields */ }Implementations§
Source§impl TreePresentation
impl TreePresentation
Sourcepub fn new(
root_style: TextStyle,
item_style: TextStyle,
connector_style: TextStyle,
) -> Self
pub fn new( root_style: TextStyle, item_style: TextStyle, connector_style: TextStyle, ) -> Self
Creates the canonical tree presentation with square line glyphs.
Sourcepub fn get_style(&self, role: TreeRole) -> &TextStyle
pub fn get_style(&self, role: TreeRole) -> &TextStyle
Returns the style assigned to one logical tree role.
Sourcepub fn style(self, role: TreeRole, style: TextStyle) -> Self
pub fn style(self, role: TreeRole, style: TextStyle) -> Self
Replaces the style assigned to one logical tree role.
Sourcepub fn root_style(self, style: TextStyle) -> Self
pub fn root_style(self, style: TextStyle) -> Self
Replaces the root style.
Sourcepub fn item_style(self, style: TextStyle) -> Self
pub fn item_style(self, style: TextStyle) -> Self
Replaces the item style.
Sourcepub fn connector_style(self, style: TextStyle) -> Self
pub fn connector_style(self, style: TextStyle) -> Self
Replaces the connector style.
Sourcepub const fn line_glyphs(self, line_glyphs: LineGlyphs) -> Self
pub const fn line_glyphs(self, line_glyphs: LineGlyphs) -> Self
Replaces the complete one-cell connector glyph repertoire.
Sourcepub const fn indent_width(self, indent_width: usize) -> Self
pub const fn indent_width(self, indent_width: usize) -> Self
Sets the cell distance from one connector column to the next.
The width includes the junction, at least one horizontal continuation cell, and one gap before the node body.
§Panics
Panics when indent_width is less than three cells.
Sourcepub fn compose<T>(&self, tree: &Tree<T>) -> Viewwhere
T: Display,
pub fn compose<T>(&self, tree: &Tree<T>) -> Viewwhere
T: Display,
Composes displayable tree data into an intrinsically sized Canvas.
Sourcepub fn compose_with<T>(
&self,
tree: &Tree<T>,
nodes: &TreeNodePresentation<'_, T>,
) -> View
pub fn compose_with<T>( &self, tree: &Tree<T>, nodes: &TreeNodePresentation<'_, T>, ) -> View
Composes tree data with typed node formatting and text-style overrides.
Trait Implementations§
Source§impl Clone for TreePresentation
impl Clone for TreePresentation
Source§fn clone(&self) -> TreePresentation
fn clone(&self) -> TreePresentation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TreePresentation
impl Debug for TreePresentation
Source§impl PartialEq for TreePresentation
impl PartialEq for TreePresentation
Source§fn eq(&self, other: &TreePresentation) -> bool
fn eq(&self, other: &TreePresentation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TreePresentation
Auto Trait Implementations§
impl Freeze for TreePresentation
impl RefUnwindSafe for TreePresentation
impl Send for TreePresentation
impl Sync for TreePresentation
impl Unpin for TreePresentation
impl UnsafeUnpin for TreePresentation
impl UnwindSafe for TreePresentation
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