1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-24 00:01:11 +01:00

add Service impl for Box<S>

This commit is contained in:
Nikolay Kim 2018-12-09 10:14:08 -08:00
parent 5f37d85f9b
commit a60bf691d5
2 changed files with 29 additions and 0 deletions

12
actix-service/CHANGES.md Normal file
View File

@ -0,0 +1,12 @@
# Changes
## [0.1.1] - 2018-12-09
### Added
* Added Service impl for Box<S: Service>
## [0.1.0] - 2018-12-09
* Initial import

View File

@ -280,6 +280,23 @@ where
}
}
impl<S, Request> Service<Request> for Box<S>
where
S: Service<Request> + ?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<F, R, E, S, Request> NewService<Request> for F
where
F: Fn() -> R,