[][src]Struct thruster_core::route_tree::RouteTree

pub struct RouteTree<T: 'static + Context + Send> {
    pub root_node: Node<T>,
    pub generic_root_node: Node<T>,
    pub specific_root_node: Node<T>,
}

Fields

root_node: Node<T>generic_root_node: Node<T>specific_root_node: Node<T>

Methods

impl<T: 'static + Context + Send> RouteTree<T>[src]

pub fn new() -> RouteTree<T>[src]

pub fn update_root_node(&mut self)[src]

Updates the root_node of the tree by merging the generic tree into the specific tree. This is necessary after adding any routes to ensure that the matching functions of the tree are up to date.

pub fn add_use_node(&mut self, route: &str, middleware: MiddlewareChain<T>)[src]

pub fn add_route_with_method(
    &mut self,
    method: &Method,
    route: &str,
    middleware: MiddlewareChain<T>
)
[src]

pub fn add_route(&mut self, route: &str, middleware: MiddlewareChain<T>)[src]

pub fn add_route_tree(&mut self, route: &str, route_tree: RouteTree<T>)[src]

pub fn match_route(
    &self,
    route: &str
) -> (HashMap<String, String>, &MiddlewareChain<T>)
[src]

pub fn match_route_with_params(
    &self,
    route: &str,
    params: HashMap<String, String>
) -> (HashMap<String, String>, &MiddlewareChain<T>)
[src]

Trait Implementations

impl<T: 'static + Context + Send> Default for RouteTree<T>[src]

Auto Trait Implementations

impl<T> Send for RouteTree<T>

impl<T> Sync for RouteTree<T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]