Crate layer
Available on crate feature tower only.
Expand description
Layer traits and extensions.
A layer decorates an service and provides additional functionality. It
allows other services to be composed with the service that implements layer.
A middleware implements the Layer and Service trait.
- Identity
- A no-op middleware.
- LayerFn
- A
Layer implemented by a closure. See the docs for layer_fn for more details. - Stack
- Two middlewares chained together.
- Layer
- Decorates a
Service, transforming either the request or the response.
- layer_fn
- Returns a new
LayerFn that implements Layer by calling the
given function.