Skip to main content

apply_fn

Function apply_fn 

Source
pub fn apply_fn<S, St, Req, F, In, Out, Err>(
    service: impl IntoService<S, St, Req>,
    f: F,
) -> ServiceChain<Apply<S, St, Req, F, In, Out, Err>, St, In>
where S: Service<St, Req>, F: AsyncFn(In, &ApplyCtx<'_, S, St, Req>) -> Result<Out, Err>, Err: From<<S as Service<St, Req>>::Error>,
Expand description

Applies an asynchronous middleware function to a service.

The function receives an input request and an ApplyCtx that can call the wrapped service.