Skip to content

Commit bf9bd97

Browse files
committed
split ServiceExt trait
1 parent 61939c7 commit bf9bd97

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

actix-service/CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes
22

3+
## [0.1.3] - 2018-12-12
4+
5+
## Changed
6+
7+
* Split service combinators to separate trait
8+
9+
310
## [0.1.2] - 2018-12-12
411

512
### Fixed

actix-service/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "actix-service"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
55
description = "Actix Service"
66
keywords = ["network", "framework", "async", "futures"]

actix-service/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ pub trait Service<Request> {
5050
/// Calling `call` without calling `poll_ready` is permitted. The
5151
/// implementation must be resilient to this fact.
5252
fn call(&mut self, req: Request) -> Self::Future;
53+
}
5354

55+
/// An extension trait for `Service`s that provides a variety of convenient
56+
/// adapters
57+
pub trait ServiceExt<Request>: Service<Request> {
5458
/// Apply function to specified service and use it as a next service in
5559
/// chain.
5660
fn apply<T, I, F, Out, Req>(
@@ -146,6 +150,8 @@ pub trait Service<Request> {
146150
}
147151
}
148152

153+
impl<T: ?Sized, Request> ServiceExt<Request> for T where T: Service<Request> {}
154+
149155
/// Creates new `Service` values.
150156
///
151157
/// Acts as a service factory. This is useful for cases where new `Service`

0 commit comments

Comments
 (0)