Struct shio::router::Route
[−]
[src]
pub struct Route { /* fields omitted */ }
Route contains a [Handler
] and information for matching against requests.
Methods
impl Route
[src]
fn new<P, H>(method: Method, pattern: P, handler: H) -> Self where
P: Into<Pattern>,
H: Handler + 'static,
<H::Result as IntoFuture>::Error: Debug + Send + Sync,
P: Into<Pattern>,
H: Handler + 'static,
<H::Result as IntoFuture>::Error: Debug + Send + Sync,
Constructs a new Route
which matches against the provided information.
Route::new(Method::Post, "/inbox", |_| { // [...] });
Trait Implementations
impl<P, H> From<(Method, P, H)> for Route where
P: Into<Pattern>,
H: Handler + 'static,
<H::Result as IntoFuture>::Error: Debug + Send + Sync,
[src]
P: Into<Pattern>,
H: Handler + 'static,
<H::Result as IntoFuture>::Error: Debug + Send + Sync,
impl Handler for Route
[src]
type Result = BoxFutureResponse<Error>
fn call(&self, ctx: Context) -> Self::Result
fn into_box(self) -> BoxHandler where
Self: Sized + 'static,
Self: Sized + 'static,