pub fn with_timeout_async<S, F, Fut>(
duration: Duration,
handler: F,
) -> impl Fn(Request, PathParams, ConnectionInfo, Arc<S>) -> Pin<Box<dyn Future<Output = Response> + Send + 'static>> + Send + Sync + 'staticExpand description
Wraps an AsyncAppWithState<S> handler so its future is dropped —
genuinely cancelled at its next .await point — if it doesn’t
resolve within duration. Backed by tokio::time::timeout; requires
the http2 feature. No Clone bound on S: AsyncAppWithState
already passes state as an owned Arc<S>.