Skip to main content

TreeNavigation

Trait TreeNavigation 

Source
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§

Source

fn is_expanded(&self, node_id: &str) -> bool

Check if a node is expanded.

Source

fn expand(&mut self, node_id: &str)

Expand a node.

Source

fn collapse(&mut self, node_id: &str)

Collapse a node.

Source

fn expand_all(&mut self)

Expand all nodes.

Source

fn collapse_all(&mut self)

Collapse all nodes.

Provided Methods§

Source

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".

Implementors§