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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user