Expand description
Layer type and utilities.
Layers are the abstraction of middleware in Rama.
Direct copy of tower-layer.
Modules§
- Middleware that clones a value into the incoming Context.
- Middleware that gets called with a clone of the value of to given type if it is available in the current
Context
. - A middleware that limits the number of in-flight requests.
- Middleware that applies a timeout to requests.
Structs§
- Middleware for adding some shareable value to incoming Context.
- Consumes this service’s error value and returns
Infallible
. - A
Layer
that producesConsumeErr
services. - Middleware for adding some shareable value to incoming Context.
- A
MakeLayerError
implementation that returns a new error value every time. - A
MakeLayerError
implementation that always returns clone of the same error value. - A
Layer
implemented by a closure. See the docs forlayer_fn
for more details. - Limit requests based on a
Policy
. - Limit requests based on a
Policy
. - Maps this service’s error value to a different value.
- Composes a function in front of the service.
- A
Layer
that producesMapRequest
services. - Maps this service’s response value to a different value.
- A
Layer
that produces aMapResponse
service. - Maps this service’s result type (
Result<Self::Response, Self::Error>
) to a different value, regardless of whether the future succeeds or fails. - Middleware that can be used to map the state, and pass it as the new state for the inner service.
- Middleware that can be used to map the state, and pass it as the new state for the inner service.
- Applies a timeout to requests.
- Applies a timeout to requests via the supplied inner service.
- Service which traces the error using [
tracing
], of the innerService
.
Traits§
- A layer that produces a Layered service (middleware(inner service)).