1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

allow to use fn with multiple arguments with .with()/.with_async()

This commit is contained in:
Nikolay Kim
2018-08-16 20:29:06 -07:00
parent 248bd388ca
commit eb1e9a785f
12 changed files with 169 additions and 55 deletions

View File

@@ -17,6 +17,7 @@ use pred::Predicate;
use resource::{DefaultResource, Resource};
use router::{ResourceDef, Router};
use server::Request;
use with::WithFactory;
/// Resources scope
///
@@ -222,7 +223,7 @@ impl<S: 'static> Scope<S> {
/// ```
pub fn route<T, F, R>(mut self, path: &str, method: Method, f: F) -> Scope<S>
where
F: Fn(T) -> R + 'static,
F: WithFactory<T, S, R>,
R: Responder + 'static,
T: FromRequest<S> + 'static,
{