block_on
function · ferroui-system · v0.5.0
fn block_on<F>(future: F) -> <F as >::Output
where F: Future + 'static,
<F as >::Output: 'static
Runs future on the current thread until it ends, and gives its output: it is spawned in the
queue of the thread (spawn_local), and the thread waits for wakes from other threads in
between (a thread with nothing else to run: a console program, a test, a worker). While it
runs, no schedule is current (current_schedule), so the tasks that its future spawns are in
the queue of the thread too, which this waits on.
Panics
With the panic of the future. Never returns when nothing wakes the future again: a future that waits for this thread itself (work queued on a schedule of the thread) has to be ended by something that runs before it waits.
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.