[][src]Struct salvo::Router

pub struct Router { /* fields omitted */ }

Methods

impl Router[src]

pub fn new(path: &str) -> Router[src]

pub fn scope(&mut self, path: &str) -> &mut Router[src]

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

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

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

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

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

Like route, but specialized to the Get method.

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

Like route, but specialized to the Post method.

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

Like route, but specialized to the Put method.

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

Like route, but specialized to the Delete method.

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

Like route, but specialized to the Head method.

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

Like route, but specialized to the Patch method.

pub fn options<H: Handler>(&mut self, handler: H) -> &mut Router[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>,