From a60bf691d55e04b06bb9661e721964d41f422818 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 9 Dec 2018 10:14:08 -0800 Subject: [PATCH] add Service impl for Box --- actix-service/CHANGES.md | 12 ++++++++++++ actix-service/src/lib.rs | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 actix-service/CHANGES.md diff --git a/actix-service/CHANGES.md b/actix-service/CHANGES.md new file mode 100644 index 00000000..81419ee1 --- /dev/null +++ b/actix-service/CHANGES.md @@ -0,0 +1,12 @@ +# Changes + +## [0.1.1] - 2018-12-09 + +### Added + +* Added Service impl for Box + + +## [0.1.0] - 2018-12-09 + +* Initial import diff --git a/actix-service/src/lib.rs b/actix-service/src/lib.rs index 452ccea7..aaf1356c 100644 --- a/actix-service/src/lib.rs +++ b/actix-service/src/lib.rs @@ -280,6 +280,23 @@ where } } +impl Service for Box +where + S: Service + ?Sized, +{ + type Response = S::Response; + type Error = S::Error; + type Future = S::Future; + + fn poll_ready(&mut self) -> Poll<(), S::Error> { + (**self).poll_ready() + } + + fn call(&mut self, request: Request) -> S::Future { + (**self).call(request) + } +} + impl NewService for F where F: Fn() -> R,