Module util

Source
Available on crate feature util only.
Expand description

Various utility types and functions that are generally used with Tower.

Modules§

error
Error types
future
Future types
rng
PRNG utilities for tower middleware.

Structs§

AndThen
Service returned by the and_then combinator.
AndThenLayer
A Layer that produces a AndThen service.
BoxCloneService
A Clone + Send boxed Service.
BoxCloneServiceLayer
A Clone + Send boxed Layer.
BoxCloneSyncService
A Clone + Send + Sync boxed Service.
BoxCloneSyncServiceLayer
A Clone + Send + Sync boxed Layer.
BoxLayer
A boxed Layer trait object.
BoxService
A boxed Service + Send trait object.
CallAll
This is a Stream of responses resulting from calling the wrapped Service for each request received on the wrapped Stream.
CallAllUnordered
A stream of responses received from the inner service in received order.
FutureService
A type that implements Service for a Future that produces a Service.
MapErr
Service returned by the map_err combinator.
MapErrLayer
A Layer that produces MapErr services.
MapFuture
Service returned by the map_future combinator.
MapFutureLayer
A Layer that produces a MapFuture service.
MapRequest
Service returned by the MapRequest combinator.
MapRequestLayer
A Layer that produces MapRequest services.
MapResponse
Service returned by the map_response combinator.
MapResponseLayer
A Layer that produces a MapResponse service.
MapResult
Service returned by the map_result combinator.
MapResultLayer
A Layer that produces a MapResult service.
Oneshot
A Future consuming a Service and request, waiting until the Service is ready, and then calling Service::call with the request, and waiting for that Future.
Optional
Optionally forwards requests to an inner service.
Ready
A future that yields a mutable reference to the service when it is ready to accept a request.
ReadyOneshot
A Future that yields the service when it is ready to accept a request.
ServiceFn
A Service implemented by a closure.
Then
Service returned by the then combinator.
ThenLayer
A Layer that produces a Then service.
UnsyncBoxService
A boxed Service trait object.

Enums§

Either
Combine two different service types into a single type.

Traits§

ServiceExt
An extension trait for Services that provides a variety of convenient adapters

Functions§

future_service
Returns a new FutureService for the given future.
option_layer
Convert an Option<Layer> into a Layer.
service_fn
Returns a new ServiceFn with the given closure.