[−][src]Struct salvo::prelude::Router
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]
&mut self,
method: RouteMethod,
handler: H
) -> &mut Router
pub fn after<H: Handler>(
&mut self,
method: RouteMethod,
handler: H
) -> &mut Router
[src]
&mut self,
method: RouteMethod,
handler: H
) -> &mut Router
pub fn detect(
&self,
method: HttpMethod,
segments: Vec<&str>
) -> (bool, Vec<Arc<dyn Handler>>, HashMap<String, String>)
[src]
&self,
method: HttpMethod,
segments: Vec<&str>
) -> (bool, Vec<Arc<dyn Handler>>, HashMap<String, String>)
pub fn route<H: Handler>(
&mut self,
method: RouteMethod,
handler: H
) -> &mut Router
[src]
&mut self,
method: RouteMethod,
handler: H
) -> &mut Router
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
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,
ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut I
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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.
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>,