commit | 3b350dee37b33512117ea9a4975d30728ebb9ebc | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Fri Sep 20 17:29:11 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Fri Sep 20 17:29:11 2024 +0000 |
tree | 8e0200c672a550de7abd4ad42d24547c9a369027 | |
parent | b40ab9cff1b71ee630d955793467e899022bc6a7 [diff] | |
parent | ea56730bd09b50cab4c95f4020028b1bb458f6d5 [diff] |
Migrate 26 crates to monorepo am: f58c2cd316 am: ea56730bd0 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tower-service/+/3272553 Change-Id: I08ee77703b4d2116b425750d47dbfb1be8c386b9 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.