INNER CODE UNIT · Rust

block_on

tangle-network/blueprint · crates/benchmarking/src/lib.rs:6

    fn block_on<F>(&self, future: F) -> F::Output
    where
        F: blueprint_std::future::Future;
}

/// The [`tokio`](https://crates.io/crates/tokio) runtime.
///
/// This will execute the benchmark using the `tokio` runtime.
#[derive(Debug, Clone, Copy)]
pub struct TokioRuntime;

impl Runtime for TokioRuntime {
    fn block_on<F>(&self, future: F) -> F::Output
    where
        F: blueprint_std::future::Future,
    {
        let rt = tokio::runtime::Handle::current();
        rt.block_on(future)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…