pub struct Node<T> { /* private fields */ }Expand description
Node structure to represent the internal structure of a router.
A router is simply a Node which doesn’t have any parent nodes,
which allows for the recursive structure of the tree. Each
Node can have a value of the generic type, which is the value
returned when routing occurs.
Every Node also has an associated Matcher which is used
to test for compatibility when routing (because not every node
is applicable on a given segment order). This Matcher is
automatically provided to the Node at creation time and is
calculated by the routing system.
Lastly, a Node can have child instances to represent the
recursive structure of a router. These children are stored in
a Vec as there’s currently no logical way to index them into
a more suitable structure. If a Node has no children, the
containing vector does not require any memory allocation. Any
memory will be allocated lazily, and should remain minimal in
most standard cases (as it depends on the allocator in use).