pub trait Runtime: Send + 'static {
    type JoinError: JoinError + Send;
    type JoinHandle: Future<Output = Result<(), Self::JoinError>> + Send;

    // Required method
    fn spawn<F>(fut: F) -> Self::JoinHandle
       where F: Future<Output = ()> + Send + 'static;
}
Expand description

Generic Rust async/await runtime

Required Associated Types§

source

type JoinError: JoinError + Send

The error returned by a JoinHandle after being awaited

source

type JoinHandle: Future<Output = Result<(), Self::JoinError>> + Send

A future that completes with the result of the spawned task

Required Methods§

source

fn spawn<F>(fut: F) -> Self::JoinHandlewhere F: Future<Output = ()> + Send + 'static,

Spawn a future onto this runtime’s event loop

Implementors§