pub trait Host: Send {
// Required methods
fn now(&mut self) -> Result<Instant>;
fn get_resolution(&mut self) -> Result<Duration>;
}
p3
only.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.
For completeness, this function traps if it’s not possible to represent
the value of the clock in an instant
. Consequently, implementations
should ensure that the starting time is low enough to avoid the
possibility of overflow in practice.
Sourcefn get_resolution(&mut self) -> Result<Duration>
fn get_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.
For completeness, this function traps if it’s not possible to represent
the value of the clock in an instant
. Consequently, implementations
should ensure that the starting time is low enough to avoid the
possibility of overflow in practice.
Source§fn get_resolution(&mut self) -> Result<Duration>
fn get_resolution(&mut self) -> Result<Duration>
Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.