1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-09-02 07:16:37 +02:00

add clone impls for combinator services

This commit is contained in:
Nikolay Kim
2018-09-05 13:54:15 -07:00
parent 8540d81dcf
commit 983223a839
5 changed files with 75 additions and 2 deletions

View File

@@ -27,6 +27,22 @@ where
}
}
impl<T, F, R, Req> Clone for Apply<T, F, R, Req>
where
T: Service + Clone,
T::Error: Into<<R::Future as Future>::Error>,
F: Fn(Req, &mut T) -> R + Clone,
R: IntoFuture,
{
fn clone(&self) -> Self {
Apply {
service: self.service.clone(),
f: self.f.clone(),
r: PhantomData,
}
}
}
impl<T, F, R, Req> Service for Apply<T, F, R, Req>
where
T: Service,