pub trait Host {
// Required methods
fn now(&mut self) -> Instant;
fn resolution(&mut self) -> Duration;
fn subscribe_instant(&mut self, when: Instant) -> Resource<Pollable>;
fn subscribe_duration(&mut self, when: Duration) -> Resource<Pollable>;
}
Required Methods§
Sourcefn now(&mut self) -> Instant
fn now(&mut self) -> 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) -> Duration
fn resolution(&mut self) -> Duration
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.
Sourcefn subscribe_instant(&mut self, when: Instant) -> Resource<Pollable>
fn subscribe_instant(&mut self, when: Instant) -> Resource<Pollable>
Create a pollable
which will resolve once the specified instant
has occurred.
Sourcefn subscribe_duration(&mut self, when: Duration) -> Resource<Pollable>
fn subscribe_duration(&mut self, when: Duration) -> Resource<Pollable>
Create a pollable
that will resolve after the specified duration has
elapsed from the time this function is invoked.
Implementations on Foreign Types§
Source§impl<_T: Host + ?Sized> Host for &mut _T
impl<_T: Host + ?Sized> Host for &mut _T
Source§fn now(&mut self) -> Instant
fn now(&mut self) -> 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) -> Duration
fn resolution(&mut self) -> Duration
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.