1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 09:36:39 +02:00

added extractor configuration

This commit is contained in:
Nikolay Kim
2018-04-03 22:06:18 -07:00
parent a255a6fb69
commit df21892b5b
10 changed files with 253 additions and 62 deletions

View File

@@ -255,8 +255,8 @@ impl<S> App<S> where S: 'static {
/// });
/// }
/// ```
pub fn resource<F>(mut self, path: &str, f: F) -> App<S>
where F: FnOnce(&mut ResourceHandler<S>) + 'static
pub fn resource<F, R>(mut self, path: &str, f: F) -> App<S>
where F: FnOnce(&mut ResourceHandler<S>) -> R + 'static
{
{
let parts = self.parts.as_mut().expect("Use after finish");
@@ -272,8 +272,8 @@ impl<S> App<S> where S: 'static {
}
/// Default resource is used if no matched route could be found.
pub fn default_resource<F>(mut self, f: F) -> App<S>
where F: FnOnce(&mut ResourceHandler<S>) + 'static
pub fn default_resource<F, R>(mut self, f: F) -> App<S>
where F: FnOnce(&mut ResourceHandler<S>) -> R + 'static
{
{
let parts = self.parts.as_mut().expect("Use after finish");