pub trait RuntimeCompletion: 'static {
type Sleep: Future<Output = ()>;
// Required methods
fn sleep(duration: Duration) -> Self::Sleep;
fn block_on<F: Future>(future: F) -> Result<F::Output, Error>;
}Expand description
Base async scheduling — timer support for all runtimes.
This is the foundation for all runtimes. Every runtime (tokio, smol, compio,
wasm) implements this trait. It provides only the sleep primitive; spawning
is split into RuntimeLocal (completion-based) and RuntimePoll
(work-stealing) to prevent runtime-inappropriate spawn calls from compiling.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".