Expand description
Layer type and utilities.
Layers are the abstraction of middleware in Rama.
Direct copy of tower-layer.
Re-exports§
pub use timeout::Timeout;
pub use timeout::TimeoutLayer;
pub use limit::Limit;
pub use limit::LimitLayer;
pub use add_extension::AddExtension;
pub use add_extension::AddExtensionLayer;
Modules§
- Middleware that clones a value into the incoming Context.
- Request-agnostic layers that act in function of the HTTP Application Layer, regardless of the layer the service itself operates on.
- A middleware that limits the number of in-flight requests.
- Middleware that applies a timeout to requests.
Structs§
- Executes a new future after this service’s future resolves.
- Consumes this service’s error value and returns
Infallible
. - A
Layer
that producesConsumeErr
services. - A no-op middleware.
- 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. - 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.
- Two middlewares chained together.
- Layer to map the result of a service.
- Service which traces the error using [
tracing
], of the innerService
.
Traits§
- A layer that produces a Layered service (middleware(inner service)).