tree: 291d88c657f422a6c9b6b5c41cb3b26e350c44fc [path history] [tgz]
  1. src/
  2. .cargo-checksum.json
  3. CHANGELOG.md
  4. Cargo.toml
  5. LICENSE
  6. README.md
third_party/rust_crates/vendor/tower-service/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.

async fn(Request) -> Result<Response, Error>

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.