pub struct Router { /* private fields */ }Implementations§
source§impl Router
impl Router
pub fn prepare(&mut self)
pub fn middleware<M>(&mut self, middleware: M) -> &mut Selfwhere M: Middleware,
pub fn group<P, F>(&mut self, prefix: P, build: F) -> &mut Selfwhere P: AsRef<str>, F: FnOnce(&mut Path<'_>),
pub fn get<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn post<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn options<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn put<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn delete<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn head<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn trace<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn connect<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn patch<P, H>(&mut self, path: P, handler: H) -> Path<'_>where P: AsRef<str>, H: Handler,
pub fn fallback<H>(&mut self, handler: H) -> &mut Selfwhere H: Handler,
pub async fn handle(&self, request: Request) -> Result
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§
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