pub struct Tree {
pub label: Option<Box<dyn Content>>,
pub content: Box<dyn Content>,
pub subtrees: Vec<Tree>,
}Expand description
A tree node containing content and child subtrees.
Trees are built from a root node with zero or more child nodes, each of which can have their own children. Nodes can optionally have labels that appear alongside their content.
§Example
use tree_display::{Tree, format::Member};
let tree = Tree::leaf("root")
.labeled(Member::new("label"));Fields§
§label: Option<Box<dyn Content>>Optional label displayed next to the content
content: Box<dyn Content>The main content of this node
subtrees: Vec<Tree>Child subtrees
Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Tree
impl !Send for Tree
impl !Sync for Tree
impl !UnwindSafe for Tree
impl Freeze 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
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.