ic-query 0.0.9

Internet Computer query CLI for NNS, SNS, and related public network metadata
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::future::Future;

pub fn block_on_current_thread<F>(future: F) -> Result<F::Output, String>
where
    F: Future,
{
    let runtime = tokio::runtime::Builder::new_current_thread()
        .enable_all()
        .build()
        .map_err(|err| err.to_string())?;
    Ok(runtime.block_on(future))
}