Node

Struct Node 

Source
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).

Auto Trait Implementations§

§

impl<T> Freeze for Node<T>
where T: Freeze,

§

impl<T> !RefUnwindSafe for Node<T>

§

impl<T> Send for Node<T>
where T: Send,

§

impl<T> Sync for Node<T>
where T: Sync,

§

impl<T> Unpin for Node<T>
where T: Unpin,

§

impl<T> !UnwindSafe for Node<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.