pub struct Tree { /* private fields */ }Expand description
A Tree structure that manages a collection of nodes in a hierarchical manner.
It utilizes a cursor to navigate and manipulate the nodes within the tree.
Implementations§
source§impl Tree
impl Tree
sourcepub fn kinds(&self) -> Vec<Kind>
pub fn kinds(&self) -> Vec<Kind>
Returns a vector of all nodes in the tree, represented with their depth information.
sourcepub fn get(&self) -> Vec<String>
pub fn get(&self) -> Vec<String>
Retrieves the data of the current node pointed by the cursor, along with its path from the root.
sourcepub fn toggle(&mut self)
pub fn toggle(&mut self)
Toggles the state of the current node and updates the cursor position accordingly.
sourcepub fn backward(&mut self) -> bool
pub fn backward(&mut self) -> bool
Moves the cursor backward in the tree, if possible.
Returns true if the cursor was successfully moved backward, false otherwise.
sourcepub fn forward(&mut self) -> bool
pub fn forward(&mut self) -> bool
Moves the cursor forward in the tree, if possible.
Returns true if the cursor was successfully moved forward, false otherwise.
sourcepub fn move_to_head(&mut self)
pub fn move_to_head(&mut self)
Moves the cursor to the head of the tree.
sourcepub fn move_to_tail(&mut self)
pub fn move_to_tail(&mut self)
Moves the cursor to the tail of the tree.
Trait Implementations§
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