Struct salvo::Router[][src]

pub struct Router { /* fields omitted */ }

Implementations

impl Router[src]

pub fn new() -> Router[src]

pub fn routers(&self) -> &Vec<Router, Global>[src]

pub fn routers_mut(&mut self) -> &mut Vec<Router, Global>[src]

pub fn befores(&self) -> &Vec<Arc<dyn Handler + 'static>, Global>[src]

pub fn befores_mut(&mut self) -> &mut Vec<Arc<dyn Handler + 'static>, Global>[src]

pub fn afters(&self) -> &Vec<Arc<dyn Handler + 'static>, Global>[src]

pub fn afters_mut(&mut self) -> &mut Vec<Arc<dyn Handler + 'static>, Global>[src]

pub fn filters(&self) -> &Vec<Box<dyn Filter + 'static, Global>, Global>[src]

pub fn filters_mut(
    &mut self
) -> &mut Vec<Box<dyn Filter + 'static, Global>, Global>
[src]

pub fn detect(
    &self,
    request: &mut Request,
    path_state: &mut PathState
) -> Option<DetectMatched>
[src]

pub fn push(self, router: Router) -> Router[src]

pub fn append(self, others: Vec<Router, Global>) -> Router[src]

pub fn push_when<F>(self, func: F) -> Router where
    F: Fn(&Router) -> Option<Router>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn before<H>(self, handler: H) -> Router where
    H: Handler
[src]

pub fn after<H>(self, handler: H) -> Router where
    H: Handler
[src]

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]

pub fn then<F>(self, func: F) -> Router where
    F: FnOnce(Router) -> Router
[src]

pub fn get<H>(self, handler: H) -> Router where
    H: Handler
[src]

pub fn post<H>(self, handler: H) -> Router where
    H: Handler
[src]

pub fn put<H>(self, handler: H) -> Router where
    H: Handler
[src]

pub fn delete<H>(self, handler: H) -> Router where
    H: Handler
[src]

pub fn patch<H>(self, handler: H) -> Router where
    H: Handler
[src]

pub fn head<H>(self, handler: H) -> Router where
    H: Handler
[src]

pub fn options<H>(self, handler: H) -> Router where
    H: Handler
[src]

pub fn visit<F>(self, func: F) -> Router where
    F: Fn(Router) -> Router
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn handle_when<H, F>(self, func: F) -> Router where
    H: Handler,
    F: Fn(&Router) -> Option<H>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn get_when<H, F>(self, func: F) -> Router where
    H: Handler,
    F: Fn(&Router) -> Option<H>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn post_when<H, F>(self, func: F) -> Router where
    H: Handler,
    F: Fn(&Router) -> Option<H>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn put_when<H, F>(self, func: F) -> Router where
    H: Handler,
    F: Fn(&Router) -> Option<H>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn delete_when<H, F>(self, func: F) -> Router where
    H: Handler,
    F: Fn(&Router) -> Option<H>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn head_when<H, F>(self, func: F) -> Router where
    H: Handler,
    F: Fn(&Router) -> Option<H>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn patch_when<H, F>(self, func: F) -> Router where
    H: Handler,
    F: Fn(&Router) -> Option<H>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

pub fn options_when<H, F>(self, func: F) -> Router where
    H: Handler,
    F: Fn(&Router) -> Option<H>, 
[src]

👎 Deprecated since 0.10.4:

Please use then function instead

Trait Implementations

impl Default for Router[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,