All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Overloaded error (#661)call_all when the Stream of requests is pending (#656)Service trait (#659)Instant operations that can panic on platforms where Instant is not monotonic (#633)attributes feature on tracing dependency (#623)Buffer (#622)hdrhistogram dependency to v7.0 (#602)tokio-util dependency to v0.7 (#638)BoxCloneService which is a Clone + Send boxed Service (#615)ServiceExt::boxed and ServiceExt::boxed_clone for applying the BoxService and BoxCloneService middleware (#616)ServiceBuilder::boxed and ServiceBuilder::boxed_clone for applying BoxService and BoxCloneService layers (#616)F: Clone bound from ServiceExt::map_request (#607)Debug bounds from impl Debug for BoxService (#617)Debug bounds from impl Debug for UnsyncBoxService (#617)Req: Clone bound from Clone impls for MakeBalance, and MakeBalanceLayer (#607)Req: Debug bound from Debug impls for MakeBalance, MakeFuture, Balance, and Pool (#607)Req: Debug bound from Debug impl for ReadyCache (#607)Req: Debug bound from Debug impl for Steer (#607)doc(cfg(...)) attributes of PeakEwmaDiscover, and PendingRequestsDiscover (#610)rustdoc::broken_intra_doc_links lint (#605)Layer for ServiceBuilder (#600)ServiceBuilder::and_then analogous to ServiceExt::and_then (#601)ServiceBuilder::map_result analogous to ServiceExt::map_result (#583)GlobalConcurrencyLimitLayer to allow reusing a concurrency limit across multiple services (#574)ServiceBuilder::check_service to check the request, response, and error types of the output service. (#576)ServiceBuilder::check_service_clone to check the output service can be cloned. (#576)SpawnReady service is dropped, fixing a potential task/resource leak (#[581])ServiceExt::ready_and (renamed to ServiceExt::ready). (#567)ReadyAnd future (renamed to Ready). (#567)ServiceBuilder::layer_fn to add a layer built from a function. (#560)ServiceBuilder::map_future for transforming the futures produced by a service. (#559)ServiceBuilder::service_fn for applying Layers to an async function using util::service_fn. (#564)service_fn. (#563)BoxLayer for creating boxed Layer trait objects. (#569)ServiceExt::map_future. (#542)ServiceBuilder::option_layer to optionally add a layer. (#555)Shared which lets you implement MakeService by cloning a service. (#533)Debug. They previously wouldn't since closures never implement Debug. (#552)Clone for Steer. (#554)tracing span to spawned tasks (#557)tracing for the features that need it. (#551)Layer for Either<A, B>. (#531)Clone for FilterLayer. (#535)Clone for TimeoutLayer. (#535)Clone for RateLimitLayer. (#535)Filter::check and AsyncFilter::check methods which check a request against the filter's Predicate (#521)get_ref, get_mut, and into_inner methods to Filter and AsyncFilter, allowing access to the wrapped service (#522)layer associated function to AndThen, Then, MapRequest, MapResponse, and MapResult types. These return a Layer that produces middleware of that type, as a convenience to avoid having to import the Layer type separately. (#524)Clone impls to AndThenLayer, MapRequestLayer, and MapErrLayer, when the mapped function implements Clone (#525)FutureService::new constructor, with less restrictive bounds than the future_service free function (#523)layer_fn and LayerFn from the tower::layer module. (#516)Sync implementation for Buffer and ConcurrencyLimit (#518)tower-layer to 0.3.1 to fix broken re-exports.This is a major breaking release including a large number of changes. In particular, this release updates tower to depend on Tokio 1.0, and moves all middleware into the tower crate. In addition, Tower 0.4 reworks several middleware APIs, as well as introducing new ones.
This release does not change the core Service or Layer traits, so tower 0.4 still depends on tower-service 0.3 and tower-layer 0.3. This means that tower 0.4 is still compatible with libraries that depend on those crates.
MakeService::into_service and MakeService::as_service for converting MakeServices into Services (#492)steer middleware for routing requests to one of a set of services (#426)MapRequest middleware and ServiceExt::map_request, for applying a function to a request before passing it to the inner service (#435)MapResponse middleware and ServiceExt::map_response, for applying a function to the Response type of an inner service after its future completes (#435)MapErr middleware and ServiceExt::map_err, for applying a function to the Error returned by an inner service if it fails (#396)MapResult middleware and ServiceExt::map_result, for applying a function to the Result returned by an inner service's future regardless of whether it succeeds or fails (#499)Then middleware and ServiceExt::then, for chaining another future after an inner service's future completes (with a Response or an Error) (#500)AndThen middleware and ServiceExt::and_then, for chaining another future after an inner service's future completes successfully (#485)layer_fn, for constructing a Layer from a function taking a Service and returning a different Service (#491)FutureService, which implements Service for a Future whose Output type is a Service ([#496])BoxService::layer and UnsyncBoxService::layer, to make constructing layers more ergonomic (#503)Layer impl for &Layer (#446)Retry::get_ref, Retry::get_mut, and Retry::into_inner to access the inner service (#463)Timeout::get_ref, Timeout::get_mut, and Timeout::into_inner to access the inner service (#463)Clone and Copy impls for BufferLayer (#[493])tower-* crates were merged into tower and placed behind feature flags (#432)ServiceBuilder::service take self by reference rather than by value (#504)MakeService in the response future, rather than in poll_ready, allowing the reconnect service to be reused when a reconnect fails (#386, #437)Discover to be a sealed trait alias for a TryStream<Item = Change>. Discover implementations are now written by implementing Stream. (#443)Instrument trait to TrackCompletion (#445)NoInstrument to CompleteOnResponse (#445)BalanceLayer to MakeBalanceLayer (#449)BalanceMake to MakeBalance (#449)ready_cache::error::Failed's fmt::Debug impl to require the key type to also implement fmt::Debug (#467)Filter and Predicate to use a synchronous function as a predicate (#508)Filter and Predicate (where Predicates returned a Future) to AsyncFilter and AsyncPredicate (#508)Predicates now take a Request type by value and may return a new request, potentially of a different type (#508)Predicates may now return an error of any type (#508)RateLimit services do not reset the remaining count when rate limiting (#438, [#439])oneshot futures panic if the service does not immediately become ready (#447)ready_cache::error::Failed not returning inner error types via Error::source (#467)buffer where buffer slots were eagerly reserved for hedge requests even if they were not sent (#472)ServiceExt::ready.discover::stream module, since Discover is now an alias for Stream (#443)MakeBalance::from_rng, which caused all balancers to use the same RNG (#497)0.3.tokio 0.2futures 0.3futures-*-preview 0.3.0-alpha.19pin-project 0.4tower-buffer to 0.3.0-alpha.1bstd::futureServiceBuilder::into_inner