Skip to content

Commit a60bf69

Browse files
committed
add Service impl for Box<S>
1 parent 5f37d85 commit a60bf69

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

actix-service/CHANGES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changes
2+
3+
## [0.1.1] - 2018-12-09
4+
5+
### Added
6+
7+
* Added Service impl for Box<S: Service>
8+
9+
10+
## [0.1.0] - 2018-12-09
11+
12+
* Initial import

actix-service/src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,23 @@ where
280280
}
281281
}
282282

283+
impl<S, Request> Service<Request> for Box<S>
284+
where
285+
S: Service<Request> + ?Sized,
286+
{
287+
type Response = S::Response;
288+
type Error = S::Error;
289+
type Future = S::Future;
290+
291+
fn poll_ready(&mut self) -> Poll<(), S::Error> {
292+
(**self).poll_ready()
293+
}
294+
295+
fn call(&mut self, request: Request) -> S::Future {
296+
(**self).call(request)
297+
}
298+
}
299+
283300
impl<F, R, E, S, Request> NewService<Request> for F
284301
where
285302
F: Fn() -> R,

0 commit comments

Comments
 (0)