commit | c3524e6b9d34dba900905bbc640742cdf4836bfd | [log] [tgz] |
---|---|---|
author | Inna Palant <[email protected]> | Fri Jun 07 22:25:04 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Fri Jun 07 22:25:04 2024 +0000 |
tree | e56219879aa5e286a4080850c4345386d4a13266 | |
parent | f34066705b5714ff1f5309599203f3aec5f7a1ba [diff] | |
parent | f962d0c54d8d8626c1269c0b7bec431133b5fb7f [diff] |
Merge remote-tracking branch 'origin/upstream' am: f962d0c54d Original change: undetermined Change-Id: Ia1a307e22a36abb2780fa4a34bae0f37365179d8 Signed-off-by: Automerger Merge Worker <[email protected]>
The foundational Service
trait that Tower is based on.
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.
This project is licensed under the MIT license.
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.