pub struct TreeNode { /* private fields */ }Expand description
A node in the tree hierarchy.
Implementations§
Source§impl TreeNode
impl TreeNode
Sourcepub fn with_children(self, nodes: Vec<TreeNode>) -> Self
pub fn with_children(self, nodes: Vec<TreeNode>) -> Self
Set children from a vec.
Sourcepub fn with_expanded(self, expanded: bool) -> Self
pub fn with_expanded(self, expanded: bool) -> Self
Set whether this node is expanded.
Sourcepub fn is_expanded(&self) -> bool
pub fn is_expanded(&self) -> bool
Whether this node is expanded.
Sourcepub fn toggle_expanded(&mut self)
pub fn toggle_expanded(&mut self)
Toggle the expanded state.
Sourcepub fn visible_count(&self) -> usize
pub fn visible_count(&self) -> usize
Count all visible (expanded) nodes, including this one.
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