Struct RouteTree

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

Implementations§

Source§

impl<T: 'static + Context + Send> RouteTree<T>

Source

pub fn new() -> RouteTree<T>

Source

pub fn update_root_node(&mut self)

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.

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Trait Implementations§

Source§

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

Source§

fn default() -> RouteTree<T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for RouteTree<T>

§

impl<T> !RefUnwindSafe for RouteTree<T>

§

impl<T> Send for RouteTree<T>

§

impl<T> Sync for RouteTree<T>

§

impl<T> Unpin for RouteTree<T>

§

impl<T> !UnwindSafe for RouteTree<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.