Skip to main content

BlockingRuntime

Trait BlockingRuntime 

Source
pub trait BlockingRuntime: SharedRuntime {
    // Required method
    fn block_on<F: Future>(&self, f: F) -> Result<F::Output, Error>;
}
Expand description

Extension of SharedRuntime for runtimes that can block the current thread on a future.

Required Methods§

Source

fn block_on<F: Future>(&self, f: F) -> Result<F::Output, Error>

Drives f to completion, blocking the current thread.

Returns an io::Error if the executor cannot be accessed or constructed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§