Struct orange_trees::Node [−][src]
pub struct Node<U, T> { /* fields omitted */ }
Expand description
Node
Describes a node inside the Tree
U: is the type for the node indentifier (must implement PartialEq)
T: is the type for the node value
Implementations
new
Instantiates a new Node
.
In order to use query methods the ID should be unique for each node in the tree
with_children
Sets Node children
with_child
Create a new child in this Node
iter_mut
Returns a mutable iterator over node’s children
remove_child
Remove child from node
truncate
Truncate tree at depth.
If depth is 0
, node’s children will be cleared
sort
Sort node children by predicate
is_leaf
Returns whether this node is a leaf (which means it has no children)
query
Search for id
inside Node and return a reference to it, if exists
query_mut
Search for id
inside Node and return a mutable reference to it, if exists
find
Find a node, in this branch, by predicate.
node_by_route
Given a vector of indexes, returns the node associated to the route
route_by_node
Calculate the route of a node by its id
Trait Implementations
Auto Trait Implementations
impl<U, T> RefUnwindSafe for Node<U, T> where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<U, T> UnwindSafe for Node<U, T> where
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more