pub struct Route { /* private fields */ }
Expand description
A collection of verb-handler pair.
Implementations§
source§impl Route
impl Route
sourcepub fn push(self, method: Method, handler: BoxHandler) -> Self
pub fn push(self, method: Method, handler: BoxHandler) -> Self
Appends a HTTP verb and handler pair into the route.
sourcepub fn on<H, O>(self, method: Method, handler: H) -> Self
pub fn on<H, O>(self, method: Method, handler: H) -> Self
Appends a handler by the specified HTTP verb into the route.
sourcepub fn get<H, O>(self, handler: H) -> Self
pub fn get<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP GET
verb into the route.
sourcepub fn post<H, O>(self, handler: H) -> Self
pub fn post<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP POST
verb into the route.
sourcepub fn put<H, O>(self, handler: H) -> Self
pub fn put<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP PUT
verb into the route.
sourcepub fn delete<H, O>(self, handler: H) -> Self
pub fn delete<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP DELETE
verb into the route.
sourcepub fn head<H, O>(self, handler: H) -> Self
pub fn head<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP HEAD
verb into the route.
sourcepub fn options<H, O>(self, handler: H) -> Self
pub fn options<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP OPTIONS
verb into the route.
sourcepub fn connect<H, O>(self, handler: H) -> Self
pub fn connect<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP CONNECT
verb into the route.
sourcepub fn patch<H, O>(self, handler: H) -> Self
pub fn patch<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP PATCH
verb into the route.
sourcepub fn trace<H, O>(self, handler: H) -> Self
pub fn trace<H, O>(self, handler: H) -> Self
Appends a handler buy the HTTP TRACE
verb into the route.
sourcepub fn map_handler<F>(self, f: F) -> Self
pub fn map_handler<F>(self, f: F) -> Self
Takes a closure and creates an iterator which calls that closure on each handler.
sourcepub fn with_handler<H>(self, f: H) -> Self
pub fn with_handler<H>(self, f: H) -> Self
Adds a middleware for the routes.
Trait Implementations§
source§impl FromIterator<(Method, BoxHandler)> for Route
impl FromIterator<(Method, BoxHandler)> for Route
source§impl IntoIterator for Route
impl IntoIterator for Route
Auto Trait Implementations§
impl Freeze for Route
impl !RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl !UnwindSafe for Route
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)