diff --git a/actix-utils/CHANGES.md b/actix-utils/CHANGES.md index 851d62b9..19eef1b7 100644 --- a/actix-utils/CHANGES.md +++ b/actix-utils/CHANGES.md @@ -4,6 +4,10 @@ * Fix framed transport error handling +* Added Clone impl for Either service + +* Added Service and NewService for Stream dispatcher + ## [0.1.0] - 2018-12-09 diff --git a/actix-utils/src/either.rs b/actix-utils/src/either.rs index e5a23e49..54495005 100644 --- a/actix-utils/src/either.rs +++ b/actix-utils/src/either.rs @@ -12,6 +12,15 @@ pub enum EitherService { B(B), } +impl Clone for EitherService { + fn clone(&self) -> Self { + match self { + EitherService::A(srv) => EitherService::A(srv.clone()), + EitherService::B(srv) => EitherService::B(srv.clone()), + } + } +} + impl Service for EitherService where A: Service, @@ -61,6 +70,15 @@ where } } +impl Clone for Either { + fn clone(&self) -> Self { + match self { + Either::A(srv) => Either::A(srv.clone()), + Either::B(srv) => Either::B(srv.clone()), + } + } +} + #[doc(hidden)] pub enum EitherNewService, B: NewService, R> { A(A::Future),