pub struct TreeModel<'a, T: NodeContent> {
pub tree_ref: &'a Tree<T>,
pub level_ref: Option<&'a Vec<TreeLevel>>,
}
Expand description
Struct that represents a tree.
Reference to the tree structure, contained in the Forest.
Reference to the tree levels structure, contained in the Forest.
Create a new tree model.
forest - A Forest structure
tree_id - ID of the tree.
- An
Option with the tree model.
Create an iterator using simple traversal.
It traverses the node array from the first position to the last, ignoring the tree structure.
The iterator returns instances of TreeNode.
let forest = ...
if let Some(tree_model) = forest.tree("my_tree") {
for (n, _) in tree_model.iter() {
println!("{}", n.content.get_content());
}
}
Create an iterator using simple inverse traversal.
It traverses the node array from the last position to the first, ignoring the tree structure.
Check iter(), all iterators work the same way.
Create an iterator using the BFS algorithm.
Check iter(), all iterators work the same way.
Create an iterator using the Inverse BFS algorithm.
Check iter(), all iterators work the same way.
Create an iterator using the Inverse Levels BFS algorithm. Only available if using the levels structure.
Check iter(), all iterators work the same way.
Create an iterator using the Pre-DFS algorithm.
Check iter(), all iterators work the same way.
Create an iterator using the Inverse Pre-DFS algorithm.
Check iter(), all iterators work the same way.
Create an iterator using the Post-DFS algorithm.
Check iter(), all iterators work the same way.
Create an iterator using the Inverse Post-DFS algorithm.
Check iter(), all iterators work the same way.
Formats the value using the given formatter. Read more
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.