Skip to main content

executor_scope

Function executor_scope 

Source
pub fn executor_scope<F, T>(f: F) -> impl Future<Output = T>
where F: for<'scope> AsyncFnOnce(&ScopeExecutor<'scope, BuiltinExecutor>) -> T,
Expand description

Run an async closure with a scoped Executor wrapper that forwards spawns to this executor, waits for all spawned tasks to finish when the closure returns, and aborts any outstanding tasks if the scope future itself is cancelled.