Function run_detached

Source
pub async fn run_detached<F, R>(future: F) -> R
where F: Future<Output = R> + MaybeSend + 'static, R: MaybeSend + 'static,
Expand description

Spawns future on the runtime and awaits its completion.

Dropping the returned future does not cancel the spawned task — it runs to completion in the background. Use this when the spawned work (e.g. a storage write paired with its in-memory finalization) must not be torn apart mid-flight by caller cancellation.