pub struct Route<'a, Req: Request, Resp: Response> { /* private fields */ }Implementations§
Source§impl<'a, Req: Request, Resp: Response> Route<'a, Req, Resp>
impl<'a, Req: Request, Resp: Response> Route<'a, Req, Resp>
Sourcepub fn at<'b>(&'b mut self, path: &str) -> Route<'b, Req, Resp>
pub fn at<'b>(&'b mut self, path: &str) -> Route<'b, Req, Resp>
Extend the route with the given path.
pub fn path(&self) -> &str
pub fn with<M>(&mut self, middleware: M) -> &mut Selfwhere
M: Middleware<Req, Resp>,
pub fn reset_middleware(&mut self) -> &mut Self
pub fn serve_dir(&mut self, dir: impl AsRef<Path>) -> Result<()>
pub fn serve_file(&mut self, file: impl AsRef<Path>) -> Result<()>
pub fn method( &mut self, method: Method, ep: impl Endpoint<Req, Resp>, ) -> &mut Self
pub fn all(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
Sourcepub fn get(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
pub fn get(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
Add an endpoint for GET requests
Sourcepub fn head(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
pub fn head(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
Add an endpoint for HEAD requests
Sourcepub fn put(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
pub fn put(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
Add an endpoint for PUT requests
Sourcepub fn post(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
pub fn post(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
Add an endpoint for POST requests
Sourcepub fn delete(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
pub fn delete(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
Add an endpoint for DELETE requests
Sourcepub fn options(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
pub fn options(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
Add an endpoint for OPTIONS requests
Sourcepub fn connect(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
pub fn connect(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self
Add an endpoint for CONNECT requests
Auto Trait Implementations§
impl<'a, Req, Resp> Freeze for Route<'a, Req, Resp>
impl<'a, Req, Resp> !RefUnwindSafe for Route<'a, Req, Resp>
impl<'a, Req, Resp> Send for Route<'a, Req, Resp>
impl<'a, Req, Resp> Sync for Route<'a, Req, Resp>
impl<'a, Req, Resp> Unpin for Route<'a, Req, Resp>
impl<'a, Req, Resp> !UnwindSafe for Route<'a, Req, Resp>
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