agde_io

Trait Runtime

source
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§

source

type Sleep: Future<Output = ()> + Send + Sync

Required Methods§

source

fn spawn<T: Send + Unpin + 'static, F: Future<Output = T> + Send + 'static>( future: F, ) -> Box<dyn TaskHandle<T>>

source

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