pub struct Tree { /* private fields */ }Expand description
Tree widget for rendering hierarchical data.
Implementations§
Source§impl Tree
impl Tree
Sourcepub fn with_show_root(self, show: bool) -> Self
pub fn with_show_root(self, show: bool) -> Self
Set whether to show the root node.
Sourcepub fn with_guides(self, guides: TreeGuides) -> Self
pub fn with_guides(self, guides: TreeGuides) -> Self
Set the guide character style.
Sourcepub fn with_guide_style(self, style: Style) -> Self
pub fn with_guide_style(self, style: Style) -> Self
Set the style for guide characters.
Sourcepub fn with_label_style(self, style: Style) -> Self
pub fn with_label_style(self, style: Style) -> Self
Set the style for node labels.
Sourcepub fn with_root_style(self, style: Style) -> Self
pub fn with_root_style(self, style: Style) -> Self
Set the style for the root label.
Sourcepub fn with_persistence_id(self, id: impl Into<String>) -> Self
pub fn with_persistence_id(self, id: impl Into<String>) -> Self
Set a persistence ID for state saving.
Sourcepub fn persistence_id(&self) -> Option<&str>
pub fn persistence_id(&self) -> Option<&str>
Get the persistence ID, if set.
Trait Implementations§
Source§impl Stateful for Tree
impl Stateful for Tree
Source§type State = TreePersistState
type State = TreePersistState
The state type that gets persisted. Read more
Source§fn save_state(&self) -> TreePersistState
fn save_state(&self) -> TreePersistState
Extract current state for persistence. Read more
Source§fn restore_state(&mut self, state: TreePersistState)
fn restore_state(&mut self, state: TreePersistState)
Restore state from persistence. Read more
Source§fn state_version() -> u32
fn state_version() -> u32
State schema version for forward-compatible migrations. Read more
Source§impl TreeUndoExt for Tree
impl TreeUndoExt for Tree
Source§fn is_node_expanded(&self, path: &[usize]) -> bool
fn is_node_expanded(&self, path: &[usize]) -> bool
Check if a node is expanded.
Source§fn expand_node(&mut self, path: &[usize])
fn expand_node(&mut self, path: &[usize])
Expand a node.
Source§fn collapse_node(&mut self, path: &[usize])
fn collapse_node(&mut self, path: &[usize])
Collapse a node.
Source§impl UndoSupport for Tree
impl UndoSupport for Tree
Source§fn undo_widget_id(&self) -> UndoWidgetId
fn undo_widget_id(&self) -> UndoWidgetId
Get the widget’s unique ID for undo tracking.
Auto Trait Implementations§
impl Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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