commit | fc566c8ce19fffb3f40ef53b45685b291295170a | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue Sep 10 23:13:32 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue Sep 10 23:13:32 2024 +0000 |
tree | f8433054006ec71b7bd3b147969274761558b45d | |
parent | 0085fdf352d8d891f16f8831aad8a8abd7bc407e [diff] | |
parent | 00d411d6605a2b9df2b5092c3460f8dbedcf4f1b [diff] |
Snap for 12349386 from 00d411d6605a2b9df2b5092c3460f8dbedcf4f1b to sdk-release Change-Id: I109cc8eaade2fd0beb28a1b341588095a64dd0f6
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.