Struct tui_tree_widget::TreeState
source · pub struct TreeState { /* private fields */ }Expand description
Implementations§
source§impl TreeState
impl TreeState
pub const fn get_offset(&self) -> usize
pub fn get_all_opened(&self) -> Vec<TreeIdentifierVec>
pub fn selected(&self) -> Vec<usize>
pub fn select(&mut self, identifier: Vec<usize>)
sourcepub fn open(&mut self, identifier: TreeIdentifierVec) -> bool
pub fn open(&mut self, identifier: TreeIdentifierVec) -> bool
Open a tree node.
Returns true if the node was closed and has been opened.
Returns false if the node was already open.
sourcepub fn close(&mut self, identifier: TreeIdentifier<'_>) -> bool
pub fn close(&mut self, identifier: TreeIdentifier<'_>) -> bool
Close a tree node.
Returns true if the node was open and has been closed.
Returns false if the node was already closed.
sourcepub fn toggle(&mut self, identifier: TreeIdentifierVec)
pub fn toggle(&mut self, identifier: TreeIdentifierVec)
Toggles a tree node.
If the node is in opened then it calls close(). Otherwise it calls open().
sourcepub fn toggle_selected(&mut self)
pub fn toggle_selected(&mut self)
Toggles the currently selected tree node.
See also toggle
pub fn close_all(&mut self)
sourcepub fn select_first(&mut self)
pub fn select_first(&mut self)
Select the first node.
sourcepub fn select_last(&mut self, items: &[TreeItem<'_>])
pub fn select_last(&mut self, items: &[TreeItem<'_>])
Select the last node.
sourcepub fn key_up(&mut self, items: &[TreeItem<'_>])
pub fn key_up(&mut self, items: &[TreeItem<'_>])
Handles the up arrow key. Moves up in the current depth or to its parent.
sourcepub fn key_down(&mut self, items: &[TreeItem<'_>])
pub fn key_down(&mut self, items: &[TreeItem<'_>])
Handles the down arrow key. Moves down in the current depth or into a child node.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for TreeState
impl Send for TreeState
impl Sync for TreeState
impl Unpin for TreeState
impl UnwindSafe for TreeState
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