Struct salvo_core::Router [−][src]
pub struct Router { /* fields omitted */ }
Implementations
Get current router’s children mutable reference.
Get current router’s before middlewares reference.
Get current router’s before middlewares mutable reference.
Get current router’s after middlewares reference.
Get current router’s after middlewares mutable reference.
Get current router’s filters mutable reference.
Detect current router is matched for current request.
Append all routers in a Vec as children of current router.
Please use then function instead
Add a handler as middleware, it will run before the handler in current router or it’s descendants handle the request.
Add a handler as middleware, it will run after the handler in current router or it’s descendants handle the request.
Create a new FnFilter from Fn.
When you want write router chain, this function will be useful, You can write your custom logic in FnOnce.
Create a new child router with MethodFilter to filter get method and set this child router’s handler.
Create a new child router with MethodFilter to filter post method and set this child router’s handler.
Create a new child router with MethodFilter to filter put method and set this child router’s handler.
Create a new child router with MethodFilter to filter delete method and set this child router’s handler.
Create a new child router with MethodFilter to filter patch method and set this child router’s handler.
Create a new child router with MethodFilter to filter head method and set this child router’s handler.