Skip to main content

block_on

Function block_on 

pub fn block_on<F>(runtime: &Runtime, future: F) -> <F as Future>::Output
where F: Future + Send + 'static, <F as Future>::Output: Send + 'static,
Available on crate feature dial9 only.
Expand description

Run future to completion on runtime, instrumented.

Runtime::block_on polls the future on the calling thread, outside any task, so its polls and wakes are not recorded. This spawns it through spawn_in instead and waits, so the root future shows up in the trace like any other task.

§Panics

Resumes the future’s panic on the calling thread, matching Runtime::block_on.