ratatui_toolkit/primitives/tree_view/tree_view_state/constructors/
new.rs

1//! TreeViewState::new constructor.
2
3use crate::primitives::tree_view::tree_view_state::TreeViewState;
4
5impl TreeViewState {
6    /// Creates a new tree view state with default values.
7    ///
8    /// # Returns
9    ///
10    /// A new `TreeViewState` with no selection, no expanded nodes,
11    /// and no active filter.
12    ///
13    /// # Example
14    ///
15    /// ```rust
16    /// use ratatui_toolkit::tree_view::TreeViewState;
17    ///
18    /// let state = TreeViewState::new();
19    /// assert!(state.selected_path.is_none());
20    /// assert!(state.expanded.is_empty());
21    /// ```
22    pub fn new() -> Self {
23        Self::default()
24    }
25}