Expand description
Asynchronous services, factories, middleware, and execution pipelines.
The Service trait is the crate’s central abstraction. A service
asynchronously transforms a request into a response, while
ServiceFactory constructs services and Pipeline manages readiness,
calls, and shutdown.
Re-exports§
pub use crate::pipeline::Pipeline;pub use crate::state::RequestState;pub use crate::state::State;
Modules§
Macros§
- forward_
pl_ ready - forward_
pl_ shutdown - forward_
ready - An implementation of
crate::Service::readythat forwards readiness checks to a field. - forward_
shutdown - An implementation of
crate::Service::shutdownthat forwards shutdown checks to a field.
Structs§
- Ctx
- Context provided to
Servicelifecycle methods. - Identity
- Middleware that returns the wrapped service unchanged.
- Service
Chain - A builder for composing services and combinators into one service.
- Service
Chain Factory - A builder for composing service factories and combinators.
- Stack
- Two middleware values applied in sequence.
Traits§
- Into
Service - Conversion into a
Service. - Into
Service Factory - Conversion into a
ServiceFactory. - Middleware
- Wraps an inner service during service construction.
- Service
- An asynchronous operation from a request to a response.
- Service
Caller - A common interface for values that can call a service.
- Service
Factory - A factory for asynchronously creating
Servicevalues.
Functions§
- apply
- Applies middleware to every service produced by a factory.
- apply_
fn - Applies an asynchronous middleware function to a service.
- apply_
fn_ factory - Applies an asynchronous middleware function to every service from a factory.
- factory
- Starts a
ServiceChainFactorywith one service factory. - fn_
factory - Converts an asynchronous constructor function into a
ServiceFactory. - fn_
service - Converts an asynchronous function into a
Service. - fn_
service_ st - Converts a state-aware asynchronous function into a
Service. - map_
state - Wraps a service with a fixed state value.
- map_
state_ factory - Wraps a service factory with a fixed state value.
- service
- Starts a
ServiceChainwith one service.