Struct salvo::Router [−][src]
pub struct Router { /* fields omitted */ }
Implementations
impl Router
[src]
impl Router
[src]pub fn routers_mut(&mut self) -> &mut Vec<Router, Global>
[src]
pub fn routers_mut(&mut self) -> &mut Vec<Router, Global>
[src]Get current router’s children mutable reference.
pub fn befores(&self) -> &Vec<Arc<dyn Handler + 'static>, Global>
[src]
pub fn befores(&self) -> &Vec<Arc<dyn Handler + 'static>, Global>
[src]Get current router’s before middlewares reference.
pub fn befores_mut(&mut self) -> &mut Vec<Arc<dyn Handler + 'static>, Global>
[src]
pub fn befores_mut(&mut self) -> &mut Vec<Arc<dyn Handler + 'static>, Global>
[src]Get current router’s before middlewares mutable reference.
pub fn afters(&self) -> &Vec<Arc<dyn Handler + 'static>, Global>
[src]
pub fn afters(&self) -> &Vec<Arc<dyn Handler + 'static>, Global>
[src]Get current router’s after middlewares reference.
pub fn afters_mut(&mut self) -> &mut Vec<Arc<dyn Handler + 'static>, Global>
[src]
pub fn afters_mut(&mut self) -> &mut Vec<Arc<dyn Handler + 'static>, Global>
[src]Get current router’s after middlewares mutable reference.
pub fn filters(&self) -> &Vec<Box<dyn Filter + 'static, Global>, Global>
[src]
pub fn filters(&self) -> &Vec<Box<dyn Filter + 'static, Global>, Global>
[src]Get current router’s filters reference.
pub fn filters_mut(
&mut self
) -> &mut Vec<Box<dyn Filter + 'static, Global>, Global>
[src]
pub fn filters_mut(
&mut self
) -> &mut Vec<Box<dyn Filter + 'static, Global>, Global>
[src]Get current router’s filters mutable reference.
pub fn detect(
&self,
req: &mut Request,
path_state: &mut PathState
) -> Option<DetectMatched>
[src]
pub fn detect(
&self,
req: &mut Request,
path_state: &mut PathState
) -> Option<DetectMatched>
[src]Detect current router is matched for current request.
pub fn append(self, others: Vec<Router, Global>) -> Router
[src]
pub fn append(self, others: Vec<Router, Global>) -> Router
[src]Append all routers in a Vec as children of current router.
pub fn push_when<F>(self, func: F) -> Router where
F: Fn(&Router) -> Option<Router>,
[src]
F: Fn(&Router) -> Option<Router>,
Please use then function instead
pub fn before<H>(self, handler: H) -> Router where
H: Handler,
[src]
pub fn before<H>(self, handler: H) -> Router where
H: Handler,
[src]Add a handler as middleware, it will run before the handler in current router or it’s descendants handle the request.
pub fn after<H>(self, handler: H) -> Router where
H: Handler,
[src]
pub fn after<H>(self, handler: H) -> Router where
H: Handler,
[src]Add a handler as middleware, it will run after the handler in current router or it’s descendants handle the request.
pub fn filter_fn<T>(self, func: T) -> Router where
T: Fn(&mut Request, &mut PathState) -> bool + Send + Sync + 'static,
[src]
pub fn filter_fn<T>(self, func: T) -> Router where
T: Fn(&mut Request, &mut PathState) -> bool + Send + Sync + 'static,
[src]Create a new FnFilter from Fn.
pub fn then<F>(self, func: F) -> Router where
F: FnOnce(Router) -> Router,
[src]
pub fn then<F>(self, func: F) -> Router where
F: FnOnce(Router) -> Router,
[src]When you want write router chain, this function will be useful, You can write your custom logic in FnOnce.
pub fn get<H>(self, handler: H) -> Router where
H: Handler,
[src]
pub fn get<H>(self, handler: H) -> Router where
H: Handler,
[src]Create a new child router with MethodFilter to filter get method and set this child router’s handler.
pub fn post<H>(self, handler: H) -> Router where
H: Handler,
[src]
pub fn post<H>(self, handler: H) -> Router where
H: Handler,
[src]Create a new child router with MethodFilter to filter post method and set this child router’s handler.
pub fn put<H>(self, handler: H) -> Router where
H: Handler,
[src]
pub fn put<H>(self, handler: H) -> Router where
H: Handler,
[src]Create a new child router with MethodFilter to filter put method and set this child router’s handler.
pub fn delete<H>(self, handler: H) -> Router where
H: Handler,
[src]
pub fn delete<H>(self, handler: H) -> Router where
H: Handler,
[src]Create a new child router with MethodFilter to filter delete method and set this child router’s handler.
pub fn patch<H>(self, handler: H) -> Router where
H: Handler,
[src]
pub fn patch<H>(self, handler: H) -> Router where
H: Handler,
[src]Create a new child router with MethodFilter to filter patch method and set this child router’s handler.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl !UnwindSafe for Router
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,