#[non_exhaustive]pub enum DetachOutcome<T> {
Completed(T),
Cancelled,
TimedOut,
Panicked(JoinError),
}Expand description
Outcome of run_with_cancel_and_timeout.
Self::Completed carries the future’s own return value.
Self::Cancelled and Self::TimedOut indicate the future was
detached (still running on the tokio runtime) and the caller should
return a cancel/timeout response to the client immediately.
Self::Panicked indicates the spawned future panicked; the
tokio::task::JoinError is exposed so the caller can surface it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Completed(T)
The spawned future ran to completion and returned a value.
Cancelled
The cancellation token fired before the future completed. The future was detached onto the runtime and keeps running.
TimedOut
The timeout budget elapsed before the future completed. The
future was detached onto the runtime and keeps running.
Panicked(JoinError)
The spawned future panicked. Carries the underlying
tokio::task::JoinError so the caller can decide how to
surface the panic (typical: log + return an internal-error
tool response).