Trait wasmtime_wasi::preview2::command::wasi::clocks::monotonic_clock::Host
source · 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§
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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_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.
sourcefn 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,
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.