Trait Runtime

Source
pub trait Runtime {
    type Sleep: Sleep;
    type Instant: Instant;

    // Required methods
    fn create_sleep(&self, timeout: Duration) -> Self::Sleep;
    fn now(&self) -> Self::Instant;
}
Expand description

Async runtime

Required Associated Types§

Source

type Sleep: Sleep

Sleep future type associated with this runtime

Source

type Instant: Instant

Instant type associated with this runtime

Required Methods§

Source

fn create_sleep(&self, timeout: Duration) -> Self::Sleep

Create a new sleep future with given timeout

Source

fn now(&self) -> Self::Instant

Get current time

Implementors§

Source§

impl Runtime for async_shared_timeout::runtime::AsyncIo

Source§

impl Runtime for async_shared_timeout::runtime::Tokio