[][src]Struct salvo::Router

pub struct Router {
    pub children: Vec<Router, Global>,
    pub filter: Option<Box<dyn Filter + 'static, Global>>,
    pub handler: Option<Arc<dyn Handler + 'static>>,
    pub befores: Vec<Arc<dyn Handler + 'static>, Global>,
    pub afters: Vec<Arc<dyn Handler + 'static>, Global>,
}

Fields

children: Vec<Router, Global>filter: Option<Box<dyn Filter + 'static, 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]

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

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

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

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 handle_when<H, F>(self, func: F) -> Router where
    F: Fn(&Router) -> Option<H>,
    H: Handler
[src]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Auto Trait Implementations

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> Instrument for T[src]

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

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>, 

impl<T> WithSubscriber for T[src]