pub trait Host: Send {
// Required methods
fn now(&mut self) -> Result<u64, Error>;
fn resolution(&mut self) -> Result<u64, Error>;
fn subscribe_instant(
&mut self,
when: u64,
) -> Result<Resource<Pollable>, Error>;
fn subscribe_duration(
&mut self,
when: u64,
) -> Result<Resource<Pollable>, Error>;
}
Required Methods§
Sourcefn now(&mut self) -> Result<u64, Error>
fn now(&mut self) -> Result<u64, Error>
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<u64, Error>
fn resolution(&mut self) -> Result<u64, Error>
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.
Implementations on Foreign Types§
Source§impl<_T> Host for &mut _T
impl<_T> Host for &mut _T
Source§fn now(&mut self) -> Result<u64, Error>
fn now(&mut self) -> Result<u64, Error>
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<u64, Error>
fn resolution(&mut self) -> Result<u64, Error>
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.