pub fn scope<'s, F, R>(func: F) -> Rwhere
F: for<'r> FnOnce(&'r Scope<'s>) -> R + 's + Send,
R: Send,
Expand description
Create a “fork-join” scope s
and invokes the closure with a
reference to s
. This closure can then spawn asynchronous tasks
into s
. Those tasks may run asynchronously with respect to the
closure; they may themselves spawn additional tasks into s
. When
the closure returns, it will block until all tasks that have been
spawned into s
complete.