pub struct Tree { /* private fields */ }Expand description
A node in a hierarchy. Mirrors rich.tree.Tree.
Implementations§
Source§impl Tree
impl Tree
Sourcepub fn new(label: impl Into<Cell>) -> Self
pub fn new(label: impl Into<Cell>) -> Self
A new tree/subtree with the given label. A string label is console
markup, as upstream’s Tree("[b]root") is; pass a
Text for a literal one.
Trait Implementations§
Source§impl Drop for Tree
impl Drop for Tree
Source§impl Renderable for Tree
impl Renderable for Tree
Source§fn measure(&self, console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, console: &Console, options: &ConsoleOptions) -> Measurement
Port of Tree.__rich_measure__: the widest label plus its indent of
four cells per level, for both bounds.
fn rich_render( &self, console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>
Source§fn fit_to_measurement(&self) -> bool
fn fit_to_measurement(&self) -> bool
Whether a top-level
Console::print shrinks this renderable to its
measured width. Upstream renders every top-level renderable at the full
console width, so the default is false; an extension may opt in.Auto Trait Implementations§
impl !RefUnwindSafe for Tree
impl !UnwindSafe for Tree
impl Freeze for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnsafeUnpin for Tree
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