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>
impl<T: 'static + Context + Send> RouteTree<T>
pub fn new() -> RouteTree<T>
Sourcepub fn update_root_node(&mut self)
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.
pub fn add_use_node(&mut self, route: &str, middleware: MiddlewareChain<T>)
pub fn add_route_with_method( &mut self, method: &Method, route: &str, middleware: MiddlewareChain<T>, )
pub fn add_route(&mut self, route: &str, middleware: MiddlewareChain<T>)
pub fn add_route_tree(&mut self, route: &str, route_tree: RouteTree<T>)
pub fn match_route( &self, route: &str, ) -> (HashMap<String, String>, &MiddlewareChain<T>)
pub fn match_route_with_params( &self, route: &str, params: HashMap<String, String>, ) -> (HashMap<String, String>, &MiddlewareChain<T>)
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more