These reviews are from Crev, a distributed system for code reviews. To add your review, set up cargo-crev.

0.3.3 (current) Rating: Strong Positive Thoroughness: Medium Understanding: High

by dpc on 2026-04-12

Review: tower-service 0.3.3

  • Local source: /home/dpc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tower-service-0.3.3
  • Upstream repository: https://github.com/tower-rs/tower
  • Upstream commit verified: 646804d77eebf072dac180cb5e1256b9ee7e0229
  • Upstream tag for version: tower-service-0.3.3
  • Verification outcome: pass

External verification

Package matches public repo https://github.com/tower-rs/tower at commit 646804d77eebf072dac180cb5e1256b9ee7e0229, which is the commit tagged as tower-service-0.3.3. The .cargo_vcs_info.json sha matches the tag exactly. All files in the tower-service/ subdirectory are bit-for-bit identical between the crates.io tarball and the upstream repo at this commit. The Cargo.toml.orig in the tarball is identical to the upstream Cargo.toml.

Code review findings

Thoroughness level chosen: medium (45 Rust LoC — small enough to read carefully end-to-end).

Claims baseline

The crate claims to define "the core Service trait to Tower" — an asynchronous, request/response based abstraction for clients and servers. It should contain only a trait definition and possibly blanket impls.

File map

  • src/lib.rsread in full. This is the only Rust source file.

Non-negotiable checks

  • build.rs: Not present. Positive.
  • Cargo.toml dependency list: Zero runtime dependencies ([dependencies] is empty). Dev-dependencies include http, tower-layer, tokio, and futures, which are appropriate for the doctest examples. No concerns.
  • Proc-macro: Not a proc-macro crate.
  • unsafe blocks: The crate has #![forbid(unsafe_code)] at line 7. Confirmed via search — zero unsafe occurrences. Positive.
  • FFI surface: None.

Detailed findings

The crate contains exactly one file (src/lib.rs) with:

  1. Lint attributes (lines 1–6): warn for missing docs/debug impls/idioms, forbid(unsafe_code). Sensible and restrictive.

  2. The Service trait (lines 311–356): A generic trait Service<Request> with three associated types (Response, Error, Future) and two methods (poll_ready, call). The Future associated type is bound to Future<Output = Result<Self::Response, Self::Error>>. call has #[must_use] on its return value. This is a clean, minimal async service abstraction.

  3. Blanket impl for &'a mut S (lines 358–373): Delegates to the inner S. Correct — lifetime bound prevents misuse.

  4. Blanket impl for Box<S> (lines 375–390): Delegates to the inner S with ?Sized bound. Correct — enables Box<dyn Service<...>> usage.

  5. Documentation (lines 19–310): Extensive rustdoc with examples showing server, client, middleware/layer, and backpressure patterns. The examples use dev-dependencies (http, tower-layer, tokio, futures). The clone footgun documentation (lines 235–310) is particularly valuable and accurate.

No red flags found. No network access, no filesystem access, no process spawning, no env var reading, no obfuscated code, no suspicious patterns. The code does exactly what it claims — defines a trait and two trivial blanket impls.

Cross-check against existing reviews

No prior reviews of this crate at any version in the local proof database.

Open questions / things skipped

  • CHANGELOG.md and README.md: Not read in detail. These are documentation-only files and do not affect the crate's behavior.
  • Test files: None present in the crate tarball (tests are in the workspace root of the tower repo, not in this subcrate's directory).

Draft review fields

  • rating: strong
  • thoroughness: medium
  • understanding: high

The current version of tower-service is 0.3.3.

0.3.1 (older version) Rating: Positive Thoroughness: Low Understanding: Medium

Approved without comment by kornelski on 2021-05-17


These reviews are from cargo-vet. To add your review, set up cargo-vet and submit your URL to its registry.

The current version of tower-service is 0.3.3.

cargo-vet does not verify reviewers' identity. You have to fully trust the source the audits are from.

safe-to-run

This crate can be compiled, run, and tested on a local workstation or in controlled automation without surprising consequences. More…

does-not-implement-crypto (implies crypto-safe)

Inspection reveals that the crate in question does not attempt to implement any cryptographic algorithms on its own.

Note that certification of this does not require an expert on all forms of cryptography: it's expected for crates we import to be "good enough" citizens, so they'll at least be forthcoming if they try to implement something cryptographic. When in doubt, please ask an expert.

crypto-safe
Implied by other criteria

All crypto algorithms in this crate have been reviewed by a relevant expert.

Note: If a crate does not implement crypto, use does-not-implement-crypto, which implies crypto-safe, but does not require expert review in order to audit for.

safe-to-deploy (implies safe-to-run)

This crate will not introduce a serious security vulnerability to production software exposed to untrusted input. More…


Lib.rs has been able to verify that all files in the crate's tarball are in the crate's repository with a git tag matching the version. Please note that this check is still in beta, and absence of this confirmation does not mean that the files don't match.

Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories, so there is a possibility that published crates have a misleading repository URL, or contain different code from the code in the repository.

To review the actual code of the crate, it's best to use cargo crev open tower-service. Alternatively, you can download the tarball of tower-service v0.3.3 or view the source online.