tower
Tower is a library of modular and reusable components for building robust clients and servers.
0.5.3
610M downloads/mo
#153 most downloaded on crates.io
tower-rs/tower
What this package is like to depend on
Last release 7 months ago
12 Jan 2026
Ships unpredictably
gaps range from 2 weeks to 2.2 years
Nearly every release is documented
notes for 21 of 22 stable releases
1 version withdrawn
withdrawn after publishing
10 years old
26 releases · first in 2016
1 release in the last 12 months
see the full history below
Release timeline
26 releases · Dec 2016 to Jan 2026Releases
latest 26-
0.5.312 Jan 2026Release notes
Open source →Added
- builder: Add
ServiceBuilder::boxed_clone_sync()helper (#804)
Fixed
- retry: Check that supplied jitter is not NaN (#843)
Release notes
Open source →Added
- builder: Add
ServiceBuilder::boxed_clone_sync()helper (#804)
Fixed
- retry: Check that supplied jitter is not NaN (#843)
- builder: Add
-
0.5.211 Dec 2024Release notes
Open source →Added
- util: Add
BoxCloneSyncServicewhich is aClone + Send + SyncboxedService(#777) - util: Add
BoxCloneSyncServiceLayerwhich is aClone + Send + SyncboxedLayer([802])
- util: Add
-
0.5.109 Sep 2024 -
0.5.013 Aug 2024Release notes
Open source →Fixed
- util:
BoxServiceis nowSync(#702)
Changed
- util: Removed deprecated
ServiceExt::ready_andmethod andReadyAnd
future (#652) - retry: Breaking Change
retry::Policy::retrynow accepts&mut Reqand&mut Resinstead of the previous mutable versions. This
increases the flexibility of the retry policy. To update, update your method signature to includemutfor both parameters. (#584) - retry: Breaking Change Change Policy to accept &mut self (#681)
- retry: Add generic backoff utilities (#685)
- retry: Add Budget trait. This allows end-users to implement their own budget and bucket implementations. (#703)
- reconnect: Breaking Change Remove unused generic parameter from
Reconnect::new(#755) - ready-cache: Allow iteration over ready services (#700)
- discover: Implement
Clonefor Change (#701) - util: Add a BoxCloneServiceLayer (#708)
- rng: use a simpler random 2-sampler (#716)
- filter: Derive
CloneforAsyncFilterLayer(#731) - general: Update IndexMap (#741)
- MSRV: Increase MSRV to 1.63.0 (#741)
Release notes
Open source →Fixed
- util:
BoxServiceis nowSync(#702)
Changed
- util: Removed deprecated
ServiceExt::ready_andmethod andReadyAndfuture (#652) - retry: Breaking Change
retry::Policy::retrynow accepts&mut Reqand&mut Resinstead of the previous mutable versions. This increases the flexibility of the retry policy. To update, update your method signature to includemutfor both parameters. (#584) - retry: Breaking Change Change Policy to accept &mut self (#681)
- retry: Add generic backoff utilities (#685)
- retry: Breaking Change
Budgetis now a trait. This allows end-users to implement their own budget and bucket implementations. (#703) - reconnect: Breaking Change Remove unused generic parameter from
Reconnect::new(#755) - ready-cache: Allow iteration over ready services (#700)
- discover: Implement
Clonefor Change (#701) - util: Add a BoxCloneServiceLayer (#708)
- rng: use a simpler random 2-sampler (#716)
- filter: Derive
CloneforAsyncFilterLayer(#731) - general: Update IndexMap (#741)
- MSRV: Increase MSRV to 1.63.0 (#741)
- util: Breaking Change
Either::AandEither::Bhave been renamedEither::LeftandEither::Right, respectively. (#637) - util: Breaking Change
Eithernow requires its two services to have the same error type. (#637) - util: Breaking Change
Eitherno longer implemenmtsFuture. (#637) - buffer: Breaking Change
Buffer<S, Request>is now generic overBuffer<Request, S::Future>.(#654) - buffer: Breaking Change
Buffer's capacity now correctly matches the specified size. Previously, the capacity was subtly off-by-one, because a slot was held even while the worker task was processing a message. (#635)
- util:
-
0.4.1317 Jun 2022 -
0.4.1216 Feb 2022Release notes
Open source →Fixed
- hedge, load, retry: Fix use of
Instantoperations that can panic
on platforms whereInstantis not monotonic (#633) - Disable
attributesfeature ontracingdependency (#623) - Remove unused dependencies and dependency features with some feature
combinations (#603, #602) - docs: Fix a typo in the RustDoc for
Buffer(#622)
Changed
Release notes
Open source →Fixed
- hedge, load, retry: Fix use of
Instantoperations that can panic on platforms whereInstantis not monotonic (#633) - Disable
attributesfeature ontracingdependency (#623) - Remove unused dependencies and dependency features with some feature combinations (#603, #602)
- docs: Fix a typo in the RustDoc for
Buffer(#622)
Changed
- hedge, load, retry: Fix use of
-
0.4.1118 Nov 2021Release notes
Open source →Added
- util: Add
BoxCloneServicewhich is aClone + SendboxedService(#615) - util: Add
ServiceExt::boxedandServiceExt::boxed_clonefor applying theBoxServiceandBoxCloneServicemiddleware (#616) - builder: Add
ServiceBuilder::boxedandServiceBuilder::boxed_clonefor applyingBoxServiceandBoxCloneServicelayers (#616)
Fixed
- util: Remove redundant
F: Clonebound fromServiceExt::map_request(#607) - util: Remove unnecessary
Debugbounds fromimpl Debug for BoxService(#617) - util: Remove unnecessary
Debugbounds fromimpl Debug for UnsyncBoxService(#617) - balance: Remove redundant
Req: Clonebound fromCloneimpls forMakeBalance, andMakeBalanceLayer(#607) - balance: Remove redundant
Req: Debugbound fromDebugimpls forMakeBalance,MakeFuture,Balance, andPool(#607) - ready-cache: Remove redundant
Req: Debugbound fromDebugimpl forReadyCache(#607) - steer: Remove redundant
Req: Debugbound fromDebugimpl forSteer(#607) - docs: Fix
doc(cfg(...))attributes ofPeakEwmaDiscover, andPendingRequestsDiscover(#610)
- util: Add
-
0.4.1019 Oct 2021 -
0.4.914 Oct 2021 withdrawnRelease notes
Open source →- Migrate to pin-project-lite (#595)
- builder: Implement
LayerforServiceBuilder(#600) - builder: Add
ServiceBuilder::and_thenanalogous toServiceExt::and_then(#601)
-
0.4.828 May 2021 -
0.4.727 Apr 2021Release notes
Open source →Added
- builder: Add
ServiceBuilder::check_serviceto check the request, response, and error types of the output service. (#576) - builder: Add
ServiceBuilder::check_service_cloneto check the output service can be cloned. (#576)
Fixed
- spawn_ready: Abort spawned background tasks when the
SpawnReadyservice is dropped, fixing a potential task/resource leak (#[581]) - Fixed broken documentation links (#578)
- builder: Add
-
0.4.627 Feb 2021Release notes
Open source →Deprecated
- util: Deprecated
ServiceExt::ready_and(renamed toServiceExt::ready). (#567) - util: Deprecated
ReadyAndfuture (renamed toReady). (#567)
Added
- builder: Add
ServiceBuilder::layer_fnto add a layer built from a function. (#560) - builder: Add
ServiceBuilder::map_futurefor transforming the futures produced by a service. (#559) - builder: Add
ServiceBuilder::service_fnfor applyingLayers to an async function usingutil::service_fn. (#564) - util: Add example for
service_fn. (#563) - util: Add
BoxLayerfor creating boxedLayertrait objects. (#569)
- util: Deprecated
-
0.4.510 Feb 2021Release notes
Open source →Added
- util: Add
ServiceExt::map_future. (#542) - builder: Add
ServiceBuilder::option_layerto optionally add a layer. (#555) - make: Add
Sharedwhich lets you implementMakeServiceby cloning a service. (#533)
Fixed
- util: Make combinators that contain closures implement
Debug. They previously wouldn't since closures never implementDebug. (#552) - steer: Implement
CloneforSteer. (#554) - spawn-ready: SpawnReady now propagates the current
tracingspan to spawned tasks (#557) - Only pull in
tracingfor the features that need it. (#551)
- util: Add
-
0.4.420 Jan 2021Release notes
Open source →Added
- util: Implement
LayerforEither<A, B>. (#531) - util: Implement
CloneforFilterLayer. (#535) - timeout: Implement
CloneforTimeoutLayer. (#535) - limit: Implement
CloneforRateLimitLayer. (#535)
Fixed
- util: Implement
-
0.4.313 Jan 2021Release notes
Open source →Added
- filter:
Filter::checkandAsyncFilter::checkmethods which check a request against the filter'sPredicate(#521) - filter: Added
get_ref,get_mut, andinto_innermethods toFilterandAsyncFilter, allowing access to the wrapped service (#522) - util: Added
layerassociated function toAndThen,Then,MapRequest,MapResponse, andMapResulttypes. These return aLayerthat produces middleware of that type, as a convenience to avoid having to import theLayertype separately. (#524) - util: Added missing
Cloneimpls toAndThenLayer,MapRequestLayer, andMapErrLayer, when the mapped function implementsClone(#525) - util: Added
FutureService::newconstructor, with less restrictive bounds than thefuture_servicefree function (#523)
- filter:
-
0.4.211 Jan 2021Release notes
Open source →Added
- Export
layer_fnandLayerFnfrom thetower::layermodule. (#516)
Fixed
- Fix missing
Syncimplementation forBufferandConcurrencyLimit(#518)
- Export
-
0.4.107 Jan 2021 -
0.4.007 Jan 2021Release notes
Open source →This is a major breaking release including a large number of changes. In particular, this release updates
towerto depend on Tokio 1.0, and moves all middleware into thetowercrate. In addition, Tower 0.4 reworks several middleware APIs, as well as introducing new ones.This release does not change the core
ServiceorLayertraits, sotower0.4 still depends ontower-service0.3 andtower-layer0.3. This means thattower0.4 is still compatible with libraries that depend on those crates.Added
- make: Added
MakeService::into_serviceandMakeService::as_servicefor convertingMakeServices intoServices (#492) - steer: Added
steermiddleware for routing requests to one of a set of services (#426) - util: Added
MapRequestmiddleware andServiceExt::map_request, for applying a function to a request before passing it to the inner service (#435) - util: Added
MapResponsemiddleware andServiceExt::map_response, for applying a function to theResponsetype of an inner service after its future completes (#435) - util: Added
MapErrmiddleware andServiceExt::map_err, for applying a function to theErrorreturned by an inner service if it fails (#396) - util: Added
MapResultmiddleware andServiceExt::map_result, for applying a function to theResultreturned by an inner service's future regardless of whether it succeeds or fails (#499) - util: Added
Thenmiddleware andServiceExt::then, for chaining another future after an inner service's future completes (with aResponseor anError) (#500) - util: Added
AndThenmiddleware andServiceExt::and_then, for chaining another future after an inner service's future completes successfully (#485) - util: Added
layer_fn, for constructing aLayerfrom a function taking aServiceand returning a differentService(#491) - util: Added
FutureService, which implementsServicefor aFuturewhoseOutputtype is aService([#496]) - util: Added
BoxService::layerandUnsyncBoxService::layer, to make constructing layers more ergonomic (#503) - layer: Added
Layerimpl for&Layer(#446) - retry: Added
Retry::get_ref,Retry::get_mut, andRetry::into_innerto access the inner service (#463) - timeout: Added
Timeout::get_ref,Timeout::get_mut, andTimeout::into_innerto access the inner service (#463) - buffer: Added
CloneandCopyimpls forBufferLayer(#[493]) - Several documentation improvements (#442, #444, #445, #449, #487, #490, #506])
Changed
- All middleware
tower-*crates were merged intotowerand placed behind feature flags (#432) - Updated Tokio dependency to 1.0 (#489)
- builder: Make
ServiceBuilder::servicetakeselfby reference rather than by value (#504) - reconnect: Return errors from
MakeServicein the response future, rather than inpoll_ready, allowing the reconnect service to be reused when a reconnect fails (#386, #437) - discover: Changed
Discoverto be a sealed trait alias for aTryStream<Item = Change>.Discoverimplementations are now written by implementingStream. (#443) - load: Renamed the
Instrumenttrait toTrackCompletion(#445) - load: Renamed
NoInstrumenttoCompleteOnResponse(#445) - balance: Renamed
BalanceLayertoMakeBalanceLayer(#449) - balance: Renamed
BalanceMaketoMakeBalance(#449) - ready-cache: Changed
ready_cache::error::Failed'sfmt::Debugimpl to require the key type to also implementfmt::Debug(#467) - filter: Changed
FilterandPredicateto use a synchronous function as a predicate (#508) - filter: Renamed the previous
FilterandPredicate(wherePredicates returned aFuture) toAsyncFilterandAsyncPredicate(#508) - filter:
Predicates now take aRequesttype by value and may return a new request, potentially of a different type (#508) - filter:
Predicates may now return an error of any type (#508)
Fixed
- limit: Fixed an issue where
RateLimitservices do not reset the remaining count when rate limiting (#438, [#439]) - util: Fixed a bug where
oneshotfutures panic if the service does not immediately become ready (#447) - ready-cache: Fixed
ready_cache::error::Failednot returning inner error types viaError::source(#467) - hedge: Fixed an interaction with
bufferwherebufferslots were eagerly reserved for hedge requests even if they were not sent (#472) - hedge: Fixed the use of a fixed 10 second bound on the hedge latency histogram resulting on errors with longer-lived requests. The latency histogram now automatically resizes (#484)
- buffer: Fixed an issue where tasks waiting for buffer capacity were not woken when a buffer is dropped, potentially resulting in a task leak (#480)
Removed
- make: Added
-
0.3.118 Jan 2020 -
0.3.019 Dec 2019Release notes
Open source →- Update all tower based crates to
0.3. - Update to
tokio 0.2 - Update to
futures 0.3
- Update all tower based crates to
-
0.3.0-alpha.1a14 Sep 2019 pre-release -
0.3.0-alpha.201 Oct 2019 pre-release -
0.3.0-alpha.111 Sep 2019 pre-release -
0.1.119 Jul 2019 -
0.1.027 Apr 2019 -
0.0.123 Dec 2016Nothing published for this version