Skip to main content

Runner

Trait Runner 

Source
pub trait Runner:
    Send
    + Sync
    + 'static {
    // Required method
    fn block_on(
        &self,
        fut: Pin<Box<dyn Future<Output = ()>>>,
    ) -> Result<(), Box<dyn Any + Send>>;
}
Expand description

Creates and drives an event loop for a system or arbiter thread.

A system shares its runner between arbiters. Implementations must support calls from multiple threads, while each supplied future stays on its calling thread.

Required Methods§

Source

fn block_on( &self, fut: Pin<Box<dyn Future<Output = ()>>>, ) -> Result<(), Box<dyn Any + Send>>

Runs the future to completion.

Return Ok(()) only after the future completes. A panic of the event loop may be returned as an error containing its panic payload or may unwind; the system performs cleanup and resumes the panic in either case.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§