Module util

Module util 

Source
Expand description

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

Modulesยง

and_then ๐Ÿ”’
boxed ๐Ÿ”’
boxed_clone ๐Ÿ”’
boxed_clone_sync ๐Ÿ”’
call_all ๐Ÿ”’
Stream<Item = Request> + Service<Request> => Stream<Item = Response>.
either ๐Ÿ”’
Contains Either and related types and functions.
error
Error types
future
Future types
future_service ๐Ÿ”’
map_err ๐Ÿ”’
map_future ๐Ÿ”’
map_request ๐Ÿ”’
map_response ๐Ÿ”’
map_result ๐Ÿ”’
oneshot ๐Ÿ”’
optional ๐Ÿ”’
Contains Optional and related types and functions.
ready ๐Ÿ”’
rng
PRNG utilities for tower middleware.
service_fn ๐Ÿ”’
then ๐Ÿ”’

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.