Sunbeam Studios

Our open-source projects, here for you!

tower-service (0.3.3)

Published 2026-03-26 11:04:37 +00:00 by siennathesane

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add tower-service@0.3.3

About this package

Trait representing an asynchronous, request / response based, client or server.

Tower Service

The foundational Service trait that Tower is based on.

Crates.io Documentation Documentation (master) MIT licensed Build Status Discord chat

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.

Dependencies

ID Version
futures ^0.3.22
http ^0.2
tokio ^1.6.2
tower-layer ^0.3
Details
Cargo
2026-03-26 11:04:37 +00:00
0
Tower Maintainers <team@tower-rs.com>
MIT
8.3 KiB
Assets (1)
Versions (1) View all
0.3.3 2026-03-26