diff --git a/src/service/apply.rs b/src/service/apply.rs index 5eea7448..2db93103 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -17,7 +17,7 @@ where impl Apply where T: Service, - F: Fn(In, &mut T) -> Out, + F: FnMut(In, &mut T) -> Out, Out: IntoFuture, { /// Create new `Apply` combinator @@ -47,7 +47,7 @@ where impl Service for Apply where T: Service, - F: Fn(In, &mut T) -> Out, + F: FnMut(In, &mut T) -> Out, Out: IntoFuture, { type Response = ::Item; @@ -76,7 +76,7 @@ where impl ApplyNewService where T: NewService, - F: Fn(In, &mut T::Service) -> Out, + F: FnMut(In, &mut T::Service) -> Out, Out: IntoFuture, { /// Create new `ApplyNewService` new service instance @@ -92,7 +92,7 @@ where impl Clone for ApplyNewService where T: NewService + Clone, - F: Fn(Out, &mut T::Service) -> Out + Clone, + F: FnMut(Out, &mut T::Service) -> Out + Clone, Out: IntoFuture, { fn clone(&self) -> Self { @@ -107,7 +107,7 @@ where impl NewService for ApplyNewService where T: NewService, - F: Fn(In, &mut T::Service) -> Out + Clone, + F: FnMut(In, &mut T::Service) -> Out + Clone, Out: IntoFuture, { type Response = ::Item; @@ -125,7 +125,7 @@ where pub struct ApplyNewServiceFuture where T: NewService, - F: Fn(In, &mut T::Service) -> Out, + F: FnMut(In, &mut T::Service) -> Out, Out: IntoFuture, { fut: T::Future, @@ -136,7 +136,7 @@ where impl ApplyNewServiceFuture where T: NewService, - F: Fn(In, &mut T::Service) -> Out, + F: FnMut(In, &mut T::Service) -> Out, Out: IntoFuture, { fn new(fut: T::Future, f: F) -> Self { @@ -151,7 +151,7 @@ where impl Future for ApplyNewServiceFuture where T: NewService, - F: Fn(In, &mut T::Service) -> Out, + F: FnMut(In, &mut T::Service) -> Out, Out: IntoFuture, { type Item = Apply; diff --git a/src/service/mod.rs b/src/service/mod.rs index 3952a801..6ca60eb7 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -35,7 +35,7 @@ pub trait ServiceExt: Service { Self: Sized, T: Service, I: IntoService, - F: Fn(Self::Response, &mut T) -> Out, + F: FnMut(Self::Response, &mut T) -> Out, Out: IntoFuture, { self.and_then(Apply::new(service.into_service(), f)) @@ -158,7 +158,7 @@ pub trait NewServiceExt: NewService { Self: Sized, T: NewService, I: IntoNewService, - F: Fn(Self::Response, &mut T::Service) -> Out + Clone, + F: FnMut(Self::Response, &mut T::Service) -> Out + Clone, Out: IntoFuture, { self.and_then(ApplyNewService::new(service, f))