[][src]Struct salvo::Router

pub struct Router { /* fields omitted */ }

Methods

impl Router[src]

pub fn new(path: impl Into<String>) -> Router[src]

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

pub fn scope(&mut self, path: impl Into<String>) -> &mut Router[src]

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

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

pub fn detect(
    &self,
    method: Method,
    segments: Vec<&str>
) -> (bool, Vec<Arc<dyn Handler + 'static>>, HashMap<String, String, RandomState>)
[src]

pub fn route<H>(&mut self, method: Method, handler: H) -> &mut Router where
    H: Handler
[src]

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

Like route, but specialized to the Get method.

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

Like route, but specialized to the Post method.

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

Like route, but specialized to the Put method.

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

Like route, but specialized to the Delete method.

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

Like route, but specialized to the Head method.

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

Like route, but specialized to the Patch method.

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

Like route, but specialized to the Options method.

Trait Implementations

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