pub struct CallHandler<'a, T = BootResponse> { /* private fields */ }Expand description
Reusable access to the next handler in an interceptor chain.
This is the Rust equivalent of Nest’s CallHandler. Calling handle
runs the remaining interceptors, pipes, validation, and handler. The handle is
reusable so an interceptor can deliberately retry the downstream pipeline
sequentially. Concurrent calls are rejected because they would share one
request-scoped provider context.
Implementations§
Source§impl<'a, T> CallHandler<'a, T>where
T: Send + 'a,
impl<'a, T> CallHandler<'a, T>where
T: Send + 'a,
Sourcepub fn from_fn<F, Fut>(call: F) -> Self
pub fn from_fn<F, Fut>(call: F) -> Self
Build a call handler from a reusable async function.
Frameworks normally provide the handler to an interceptor. This constructor is public so interceptors and combinators can be tested in isolation.
Sourcepub fn handle(&self) -> BoxFuture<'a, Result<T>>
pub fn handle(&self) -> BoxFuture<'a, Result<T>>
Run the remaining interceptor chain and underlying handler once.
A completed or cancelled call releases the handler for a later retry.
Starting overlapping calls returns BootError::Internal.