pub trait TreeNavigation: ListNavigation {
// Required methods
fn is_expanded(&self, node_id: &str) -> bool;
fn expand(&mut self, node_id: &str);
fn collapse(&mut self, node_id: &str);
fn expand_all(&mut self);
fn collapse_all(&mut self);
// Provided method
fn toggle_expand(&mut self, node_id: &str) { ... }
}Expand description
Trait for tree-based navigation state.
Extends list navigation with expand/collapse functionality for hierarchical views.
Required Methods§
Sourcefn is_expanded(&self, node_id: &str) -> bool
fn is_expanded(&self, node_id: &str) -> bool
Check if a node is expanded.
Sourcefn expand_all(&mut self)
fn expand_all(&mut self)
Expand all nodes.
Sourcefn collapse_all(&mut self)
fn collapse_all(&mut self)
Collapse all nodes.
Provided Methods§
Sourcefn toggle_expand(&mut self, node_id: &str)
fn toggle_expand(&mut self, node_id: &str)
Toggle a node’s expanded state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".