1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-22 13:45:13 +02:00

use FromRequest instead of HttpRequestExtractor

This commit is contained in:
Nikolay Kim
2018-03-29 13:12:28 -07:00
parent dfd8f1058e
commit 86dd732704
8 changed files with 93 additions and 93 deletions

View File

@@ -7,12 +7,11 @@ use http::{Method, StatusCode};
use pred;
use body::Body;
use route::Route;
use handler::{Reply, Handler, Responder};
use handler::{Reply, Handler, Responder, FromRequest};
use middleware::Middleware;
use httprequest::HttpRequest;
use httpresponse::HttpResponse;
use with::WithHandler;
use extractor::HttpRequestExtractor;
/// *Resource* is an entry in route table which corresponds to requested URL.
///
@@ -143,7 +142,7 @@ impl<S: 'static> Resource<S> {
/// ```
pub fn with<T, H>(&mut self, handler: H)
where H: WithHandler<T, S>,
T: HttpRequestExtractor<S> + 'static,
T: FromRequest<S> + 'static,
{
self.routes.push(Route::default());
self.routes.last_mut().unwrap().with(handler)