Struct salvo_core::Router [−][src]
Implementations
impl Router
[src]
pub fn new() -> Router
[src]
pub fn routers(&self) -> &Vec<Router>
[src]
pub fn routers_mut(&mut self) -> &mut Vec<Router>
[src]
pub fn befores(&self) -> &Vec<Arc<dyn Handler>>
[src]
pub fn befores_mut(&mut self) -> &mut Vec<Arc<dyn Handler>>
[src]
pub fn afters(&self) -> &Vec<Arc<dyn Handler>>
[src]
pub fn afters_mut(&mut self) -> &mut Vec<Arc<dyn Handler>>
[src]
pub fn filters(&self) -> &Vec<Box<dyn Filter>>
[src]
pub fn filters_mut(&mut self) -> &mut Vec<Box<dyn Filter>>
[src]
pub fn detect(
&self,
request: &mut Request,
path_state: &mut PathState
) -> Option<DetectMatched>
[src]
&self,
request: &mut Request,
path_state: &mut PathState
) -> Option<DetectMatched>
pub fn push(self, router: Router) -> Self
[src]
pub fn append(self, others: Vec<Router>) -> Self
[src]
pub fn push_when<F>(self, func: F) -> Self where
F: Fn(&Router) -> Option<Router>,
[src]
F: Fn(&Router) -> Option<Router>,
👎 Deprecated since 0.10.4:
Please use then function instead
pub fn before<H: Handler>(self, handler: H) -> Self
[src]
pub fn after<H: Handler>(self, handler: H) -> Self
[src]
pub fn path(self, path: impl Into<String>) -> Self
[src]
pub fn filter(self, filter: impl Filter + Sized) -> Self
[src]
pub fn filter_fn<T>(self, func: T) -> Self where
T: Fn(&mut Request, &mut PathState) -> bool + Send + Sync + 'static,
[src]
T: Fn(&mut Request, &mut PathState) -> bool + Send + Sync + 'static,
pub fn handle<H: Handler>(self, handler: H) -> Self
[src]
pub fn then<F>(self, func: F) -> Self where
F: FnOnce(Self) -> Self,
[src]
F: FnOnce(Self) -> Self,
pub fn get<H: Handler>(self, handler: H) -> Self
[src]
pub fn post<H: Handler>(self, handler: H) -> Self
[src]
pub fn put<H: Handler>(self, handler: H) -> Self
[src]
pub fn delete<H: Handler>(self, handler: H) -> Self
[src]
pub fn patch<H: Handler>(self, handler: H) -> Self
[src]
pub fn head<H: Handler>(self, handler: H) -> Self
[src]
pub fn options<H: Handler>(self, handler: H) -> Self
[src]
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>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
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>,