1 2 3 4 5 6 7 8 9
use std::future::Future; pub fn block<F: Future>(future: F) -> F::Output { tokio::runtime::Builder::new_current_thread() .enable_all() .build() .unwrap() .block_on(future) }