Trait wasmtime_wasi_http::bindings::clocks::monotonic_clock::Host
source · pub trait Host: Send {
// Required methods
fn now(&mut self) -> Result<Instant>;
fn resolution(&mut self) -> Result<Duration>;
fn subscribe_instant(&mut self, when: Instant) -> Result<Resource<Pollable>>;
fn subscribe_duration(
&mut self,
when: Duration,
) -> Result<Resource<Pollable>>;
}
Required Methods§
sourcefn now(&mut self) -> Result<Instant>
fn now(&mut self) -> Result<Instant>
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(&mut self) -> Result<Duration>
fn resolution(&mut self) -> Result<Duration>
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.
Implementations on Foreign Types§
source§impl<_T: Host + ?Sized + Send> Host for &mut _T
impl<_T: Host + ?Sized + Send> Host for &mut _T
source§fn now(&mut self) -> Result<Instant>
fn now(&mut self) -> Result<Instant>
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(&mut self) -> Result<Duration>
fn resolution(&mut self) -> Result<Duration>
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.