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.