Trait agde_io::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

Implementors§