Struct salvo::routing::Router [−][src]
Fields
children: Vec<Router, Global>
filters: Vec<Box<dyn Filter + 'static, Global>, Global>
handler: Option<Arc<dyn Handler + 'static>>
befores: Vec<Arc<dyn Handler + 'static>, Global>
afters: Vec<Arc<dyn Handler + 'static>, Global>
Implementations
impl Router
[src]
pub fn new() -> Router
[src]
pub fn detect(
&self,
request: &mut Request,
path: &mut PathState
) -> Option<DetectMatched>
[src]
&self,
request: &mut Request,
path: &mut PathState
) -> Option<DetectMatched>
pub fn visit<F>(self, func: F) -> Router where
F: Fn(Router) -> Router,
[src]
F: Fn(Router) -> Router,
pub fn push(self, router: Router) -> Router
[src]
pub fn push_when<F>(self, func: F) -> Router where
F: Fn(&Router) -> Option<Router>,
[src]
F: Fn(&Router) -> Option<Router>,
pub fn before<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn after<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn path(self, path: impl Into<String>) -> Router
[src]
pub fn filter(self, filter: impl Filter) -> Router
[src]
pub fn handle<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn handle_when<H, F>(self, func: F) -> Router where
H: Handler,
F: Fn(&Router) -> Option<H>,
[src]
H: Handler,
F: Fn(&Router) -> Option<H>,
pub fn get<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn get_when<H, F>(self, func: F) -> Router where
H: Handler,
F: Fn(&Router) -> Option<H>,
[src]
H: Handler,
F: Fn(&Router) -> Option<H>,
pub fn post<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn post_when<H, F>(self, func: F) -> Router where
H: Handler,
F: Fn(&Router) -> Option<H>,
[src]
H: Handler,
F: Fn(&Router) -> Option<H>,
pub fn put<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn put_when<H, F>(self, func: F) -> Router where
H: Handler,
F: Fn(&Router) -> Option<H>,
[src]
H: Handler,
F: Fn(&Router) -> Option<H>,
pub fn delete<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn delete_when<H, F>(self, func: F) -> Router where
H: Handler,
F: Fn(&Router) -> Option<H>,
[src]
H: Handler,
F: Fn(&Router) -> Option<H>,
pub fn head<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn head_when<H, F>(self, func: F) -> Router where
H: Handler,
F: Fn(&Router) -> Option<H>,
[src]
H: Handler,
F: Fn(&Router) -> Option<H>,
pub fn patch<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn patch_when<H, F>(self, func: F) -> Router where
H: Handler,
F: Fn(&Router) -> Option<H>,
[src]
H: Handler,
F: Fn(&Router) -> Option<H>,
pub fn options<H>(self, handler: H) -> Router where
H: Handler,
[src]
H: Handler,
pub fn options_when<H, F>(self, func: F) -> Router where
H: Handler,
F: Fn(&Router) -> Option<H>,
[src]
H: Handler,
F: Fn(&Router) -> Option<H>,
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,