commit | 526aff37491c4a8156cf3a0237c8d7aa37e60fd5 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue Sep 24 23:14:20 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue Sep 24 23:14:20 2024 +0000 |
tree | 8e0200c672a550de7abd4ad42d24547c9a369027 | |
parent | fc566c8ce19fffb3f40ef53b45685b291295170a [diff] | |
parent | f58c2cd3164463fdc51e786b37c4db4267a335c1 [diff] |
Snap for 12410557 from f58c2cd3164463fdc51e786b37c4db4267a335c1 to sdk-release Change-Id: Iad683da8ab729210f8c7ee2e485071731d5a5cb5
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.