pub struct Router { /* private fields */ }Expand description
Implementations§
Source§impl Router
impl Router
Sourcepub fn route<H, Args>(self, pattern: &str, handler: H) -> Self
pub fn route<H, Args>(self, pattern: &str, handler: H) -> Self
Adds a route that matches any HTTP method.
Sourcepub fn method_not_allowed<H, Args>(self, handler: H) -> Self
pub fn method_not_allowed<H, Args>(self, handler: H) -> Self
Sets a custom 405 Method Not Allowed handler.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Router
impl !RefUnwindSafe for Router
impl !Send for Router
impl !Sync for Router
impl Unpin for Router
impl !UnwindSafe for Router
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more