pub struct ApplyCtx<'a, S, St, Req> { /* private fields */ }Expand description
State and inner-service access for apply_fn and apply_fn_factory middleware.
Self::st borrows the current pipeline state, and Self::call invokes
the inner service with that state. The context also implements
ServiceCaller, with the same call behavior.
Calls forward directly to the inner service. Wrap it with crate::ready()
to check its independent readiness on each call, including after middleware
awaits or makes another call. The context borrows both the state and the
inner service for the middleware invocation.
Implementations§
Source§impl<S: Service<St, Req>, St, Req> ApplyCtx<'_, S, St, Req>
impl<S: Service<St, Req>, St, Req> ApplyCtx<'_, S, St, Req>
Sourcepub fn st(&self) -> &St
pub fn st(&self) -> &St
Returns the pipeline state.
Inner calls made through this context receive the same state reference.
Sourcepub fn call(&self, req: Req) -> impl Future<Output = Result<S::Res, S::Error>>
pub fn call(&self, req: Req) -> impl Future<Output = Result<S::Res, S::Error>>
Calls the inner service, preserving any explicit readiness wrapper.
This does not independently check readiness for a raw inner service.
An inner crate::ready() wrapper still checks its own readiness
cache.
Returns the inner response and error types without applying the outer middleware’s conversions.