1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-21 05:05:44 +02:00

add support for multiple extractors

This commit is contained in:
Nikolay Kim
2018-03-28 14:24:32 -07:00
parent 80f6b93714
commit 65700281e8
8 changed files with 409 additions and 57 deletions

View File

@@ -3,7 +3,6 @@ use std::marker::PhantomData;
use smallvec::SmallVec;
use http::{Method, StatusCode};
use serde::de::DeserializeOwned;
use pred;
use body::Body;
@@ -142,10 +141,9 @@ impl<S: 'static> Resource<S> {
/// ```rust,ignore
/// Resource::resource("/", |r| r.route().with(index)
/// ```
pub fn with<T, D, H>(&mut self, handler: H)
where H: WithHandler<T, D, S>,
D: HttpRequestExtractor<T, S> + 'static,
T: DeserializeOwned + 'static,
pub fn with<T, H>(&mut self, handler: H)
where H: WithHandler<T, S>,
T: HttpRequestExtractor<S> + 'static,
{
self.routes.push(Route::default());
self.routes.last_mut().unwrap().with(handler)