pub trait Host {
    // Required methods
    fn now<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Instant>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn resolution<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Duration>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_instant<'life0, 'async_trait>(
        &'life0 mut self,
        when: Instant
    ) -> Pin<Box<dyn Future<Output = Result<Resource<Pollable>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_duration<'life0, 'async_trait>(
        &'life0 mut self,
        when: Duration
    ) -> Pin<Box<dyn Future<Output = Result<Resource<Pollable>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn now<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Instant>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read the current value of the clock.

The clock is monotonic, therefore calling this function repeatedly will produce a sequence of non-decreasing values.

source

fn resolution<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Duration>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.

source

fn subscribe_instant<'life0, 'async_trait>( &'life0 mut self, when: Instant ) -> Pin<Box<dyn Future<Output = Result<Resource<Pollable>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a pollable which will resolve once the specified instant occured.

source

fn subscribe_duration<'life0, 'async_trait>( &'life0 mut self, when: Duration ) -> Pin<Box<dyn Future<Output = Result<Resource<Pollable>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a pollable which will resolve once the given duration has elapsed, starting at the time at which this function was called. occured.

Implementors§