blob: 7a25994147f9f555747ae1b3e8086eaf8463bc32 [file] [log] [blame]
use super::Runtime;
use std::future::Future;
impl Runtime {
/// Like `block_on`, but takes an `async` block
pub fn block_on_async<F>(&mut self, future: F) -> F::Output
where
F: Future,
{
use tokio_futures::compat;
match self.block_on(compat::infallible_into_01(future)) {
Ok(v) => v,
Err(_) => unreachable!(),
}
}
}