pub struct Router<T> { /* private fields */ }
Implementations§
Source§impl<T> Router<T>
impl<T> Router<T>
Sourcepub fn use_ok<F>(&mut self, handler: F) -> &mut Self
pub fn use_ok<F>(&mut self, handler: F) -> &mut Self
Adds a new middleware that apply to every request received.
Sourcepub fn get<F>(&mut self, path: &'static str, handler: F) -> &mut Self
pub fn get<F>(&mut self, path: &'static str, handler: F) -> &mut Self
Adds a new middleware that apply to a GET request received.
Sourcepub fn post<F>(&mut self, path: &'static str, handler: F) -> &mut Self
pub fn post<F>(&mut self, path: &'static str, handler: F) -> &mut Self
Adds a new middleware that apply to a POST request received.
Sourcepub fn put<F>(&mut self, path: &'static str, handler: F) -> &mut Self
pub fn put<F>(&mut self, path: &'static str, handler: F) -> &mut Self
Adds a new middleware that apply to a PUT request received.
Sourcepub fn patch<F>(&mut self, path: &'static str, handler: F) -> &mut Self
pub fn patch<F>(&mut self, path: &'static str, handler: F) -> &mut Self
Adds a new middleware that apply to a PATCH request received.
Auto Trait Implementations§
impl<T> Freeze for Router<T>
impl<T> !RefUnwindSafe for Router<T>
impl<T> Send for Router<T>
impl<T> Sync for Router<T>
impl<T> Unpin for Router<T>
impl<T> !UnwindSafe for Router<T>
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