pub trait Runtime {
type Sleep: Future<Output = ()> + Send + Sync;
// Required methods
fn spawn<T: Send + Unpin + 'static, F: Future<Output = T> + Send + 'static>(
future: F,
) -> Box<dyn TaskHandle<T>>;
fn sleep(duration: Duration) -> Self::Sleep;
}
Required Associated Types§
Required Methods§
fn spawn<T: Send + Unpin + 'static, F: Future<Output = T> + Send + 'static>( future: F, ) -> Box<dyn TaskHandle<T>>
fn sleep(duration: Duration) -> Self::Sleep
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so