mirror of
https://github.com/actix/actix-web.git
synced 2024-12-27 10:30:33 +00:00
split ServiceExt trait
This commit is contained in:
parent
61939c7af2
commit
bf9bd97173
3 changed files with 14 additions and 1 deletions
|
@ -1,5 +1,12 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.1.3] - 2018-12-12
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
* Split service combinators to separate trait
|
||||||
|
|
||||||
|
|
||||||
## [0.1.2] - 2018-12-12
|
## [0.1.2] - 2018-12-12
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "actix-service"
|
name = "actix-service"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Actix Service"
|
description = "Actix Service"
|
||||||
keywords = ["network", "framework", "async", "futures"]
|
keywords = ["network", "framework", "async", "futures"]
|
||||||
|
|
|
@ -50,7 +50,11 @@ pub trait Service<Request> {
|
||||||
/// Calling `call` without calling `poll_ready` is permitted. The
|
/// Calling `call` without calling `poll_ready` is permitted. The
|
||||||
/// implementation must be resilient to this fact.
|
/// implementation must be resilient to this fact.
|
||||||
fn call(&mut self, req: Request) -> Self::Future;
|
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
|
/// Apply function to specified service and use it as a next service in
|
||||||
/// chain.
|
/// chain.
|
||||||
fn apply<T, I, F, Out, Req>(
|
fn apply<T, I, F, Out, Req>(
|
||||||
|
@ -146,6 +150,8 @@ pub trait Service<Request> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T: ?Sized, Request> ServiceExt<Request> for T where T: Service<Request> {}
|
||||||
|
|
||||||
/// Creates new `Service` values.
|
/// Creates new `Service` values.
|
||||||
///
|
///
|
||||||
/// Acts as a service factory. This is useful for cases where new `Service`
|
/// Acts as a service factory. This is useful for cases where new `Service`
|
||||||
|
|
Loading…
Reference in a new issue