Skip to main content

Crate ntex_service

Crate ntex_service 

Source
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§

boxed
cfg
Typed, shared configuration for services.
dev
pipeline
state

Macros§

forward_pl_ready
forward_pl_shutdown
forward_ready
An implementation of crate::Service::ready that forwards readiness checks to a field.
forward_shutdown
An implementation of crate::Service::shutdown that forwards shutdown checks to a field.

Structs§

Ctx
Context provided to Service lifecycle methods.
Identity
Middleware that returns the wrapped service unchanged.
ServiceChain
A builder for composing services and combinators into one service.
ServiceChainFactory
A builder for composing service factories and combinators.
Stack
Two middleware values applied in sequence.

Traits§

IntoService
Conversion into a Service.
IntoServiceFactory
Conversion into a ServiceFactory.
Middleware
Wraps an inner service during service construction.
Service
An asynchronous operation from a request to a response.
ServiceCaller
A common interface for values that can call a service.
ServiceFactory
A factory for asynchronously creating Service values.

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 ServiceChainFactory with 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 ServiceChain with one service.