Module tower

Source
Expand description

Service request/response abstraction (HTTP middleware) for tokio and axum.

See crate ::tower.

Modules§

balance
Middleware that allows balancing load among multiple services.
buffer
Middleware that provides a buffered mpsc channel to a service.
builder
Builder types to compose layers and services
discover
Service discovery
filter
Conditionally dispatch requests to the inner service based on the result of a predicate.
hedge
Pre-emptively retry requests which have been outstanding for longer than a given latency percentile.
layer
A collection of Layer based tower services
limit
Tower middleware for limiting requests.
load
Service load measurement
load_shed
Middleware for shedding load when inner services aren’t ready.
make
Trait aliases for Services that produce specific types of Responses.
ready_cache
A cache of services
reconnect
Reconnect services when they fail.
retry
Middleware for retrying “failed” requests.
spawn_ready
When an underlying service is not ready, drive it to readiness on a background task.
steer
This module provides functionality to aid managing routing requests between Services.
timeout
Middleware that applies a timeout to requests.
util
Various utility types and functions that are generally used with Tower.

Structs§

ServiceBuilder
Declaratively construct Service values.

Traits§

Layer
Decorates a Service, transforming either the request or the response.
MakeService
Creates new Service values.
Service
An asynchronous function from a Request to a Response.
ServiceExt
An extension trait for Services that provides a variety of convenient adapters

Functions§

service_fn
Returns a new ServiceFn with the given closure.

Type Aliases§

BoxError
Alias for a type-erased error type.