pub struct TreeNode { /* private fields */ }Expand description
A node in a tree.
Implementations§
Source§impl TreeNode
impl TreeNode
Sourcepub fn with_child<T: Into<TreeNode>>(self, child: T) -> Self
pub fn with_child<T: Into<TreeNode>>(self, child: T) -> Self
Add a child node and return self (builder pattern).
Sourcepub fn with_children<I, T>(self, children: I) -> Self
pub fn with_children<I, T>(self, children: I) -> Self
Add multiple children.
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Check if this node has children.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeNode
impl RefUnwindSafe for TreeNode
impl Send for TreeNode
impl Sync for TreeNode
impl Unpin for TreeNode
impl UnwindSafe for TreeNode
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