From bf9bd97173ca3cd82e40fcde5e7b4646a2de9bd7 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 12 Dec 2018 18:32:19 -0800 Subject: [PATCH] split ServiceExt trait --- actix-service/CHANGES.md | 7 +++++++ actix-service/Cargo.toml | 2 +- actix-service/src/lib.rs | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/actix-service/CHANGES.md b/actix-service/CHANGES.md index fc8f68cd..7817e6ef 100644 --- a/actix-service/CHANGES.md +++ b/actix-service/CHANGES.md @@ -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 diff --git a/actix-service/Cargo.toml b/actix-service/Cargo.toml index ca1763ee..49a2ae1a 100644 --- a/actix-service/Cargo.toml +++ b/actix-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-service" -version = "0.1.2" +version = "0.1.3" authors = ["Nikolay Kim "] description = "Actix Service" keywords = ["network", "framework", "async", "futures"] diff --git a/actix-service/src/lib.rs b/actix-service/src/lib.rs index aaf1356c..a96dbd5b 100644 --- a/actix-service/src/lib.rs +++ b/actix-service/src/lib.rs @@ -50,7 +50,11 @@ pub trait Service { /// 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: Service { /// Apply function to specified service and use it as a next service in /// chain. fn apply( @@ -146,6 +150,8 @@ pub trait Service { } } +impl ServiceExt for T where T: Service {} + /// Creates new `Service` values. /// /// Acts as a service factory. This is useful for cases where new `Service`