Skip to content

Commit

Permalink
split ServiceExt trait
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Dec 13, 2018
1 parent 61939c7 commit bf9bd97
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions actix-service/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changes

## [0.1.3] - 2018-12-12

## Changed

* Split service combinators to separate trait


## [0.1.2] - 2018-12-12

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion actix-service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-service"
version = "0.1.2"
version = "0.1.3"
authors = ["Nikolay Kim <[email protected]>"]
description = "Actix Service"
keywords = ["network", "framework", "async", "futures"]
Expand Down
6 changes: 6 additions & 0 deletions actix-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ pub trait Service<Request> {
/// Calling `call` without calling `poll_ready` is permitted. The
/// implementation must be resilient to this fact.
fn call(&mut self, req: Request) -> Self::Future;
}

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

impl<T: ?Sized, Request> ServiceExt<Request> for T where T: Service<Request> {}

/// Creates new `Service` values.
///
/// Acts as a service factory. This is useful for cases where new `Service`
Expand Down

0 comments on commit bf9bd97

Please sign in to comment.