Struct salvo_core::Router
source ·
[−]pub struct Router { /* fields omitted */ }
Expand description
Router struct is used for route request to different handlers.
Implementations
Get current router’s children reference.
Get current router’s children mutable reference.
Get current router’s middlewares reference.
Get current router’s middlewares mutable reference.
Get current router’s filters 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.
Add a handler as middleware, it will run the handler in current router or it’s descendants handle the request.
Add a handler as middleware, it will run 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.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Router
impl !UnwindSafe for Router
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more