Expand description
Struct that contains a tree.
Set root node.
- An
Option
with the root node index (always 0).
Create new node and link it to its parent.
node_content
- Node content.
parent_node_index
- Parent node index.
- An
Option
with the new node index.
Get reference to node content.
- An
Option
with the node content reference.
Overwrite node content. It must exist.
node_content
- Node content.
node_index
- Node index.
- An
Option
with the node index.
Unlink node. It doesn’t remove node from the tree, it just disconnects it from parent.
This process is O(l) complexity, where l
is the number of nodes of the same level of node_index
.
- An
Option
with the node index.
Find node in the try by content.
The complexity of this operation is O(p), where p
is the number of elements in the path.
path
- Path of nodes, starting from root.
- An
Option
with the node index.
Get reference to nodes array.
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.