tower/tower-service
Lucio Franco c5d70481bd
layer: Add `tower-layer` and the `Layer` trait (#163)
This change introduces the new `tower-layer` crate and the foundational `Layer` trait to go along with it. This trait allows one to easily compose a set of `Service`s that take an inner service. These services only modify the request/response. This also provides the `Layer` implementation for many of the tower crates.
2019-02-27 15:28:42 -05:00
..
src layer: Add `tower-layer` and the `Layer` trait (#163) 2019-02-27 15:28:42 -05:00
CHANGELOG.md tower-service v0.2.0 (#135) 2018-12-12 16:14:05 -05:00
Cargo.toml tower-service v0.2.0 (#135) 2018-12-12 16:14:05 -05:00
LICENSE Minor documentation improvements (#93) 2018-08-09 10:08:57 -07:00
README.md Update link to Service trait docs in tower-service README (#146) 2019-01-14 10:08:43 -08:00

README.md

Tower Service

The foundational Service trait that Tower is based on.

Overview

The Service trait provides the foundation upon which Tower is built. It is a simple, but powerful trait. At its heart, Service is just an asynchronous function of request to response.

fn(Request) -> Future<Item = Response>

Implementations of Service take a request, the type of which varies per protocol, and returns a future representing the eventual completion or failure of the response.

Services are used to represent both clients and servers. An instance of Service is used through a client; a server implements Service.

By using standardizing the interface, middleware can be created. Middleware implement Service by passing the request to another Service. The middleware may take actions such as modify the request.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tower by you, shall be licensed as MIT, without any additional terms or conditions.