pub trait Host: Send {
// Required methods
fn now(&mut self) -> impl Future<Output = Result<Mark>> + Send;
fn get_resolution(
&mut self,
) -> impl Future<Output = Result<Duration>> + Send;
}Required Methods§
Sourcefn now(&mut self) -> impl Future<Output = Result<Mark>> + Send
fn now(&mut self) -> impl Future<Output = Result<Mark>> + Send
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 a mark. Consequently, implementations
should ensure that the starting time is low enough to avoid the
possibility of overflow in practice.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
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) -> impl Future<Output = Result<Mark>> + Send
fn now(&mut self) -> impl Future<Output = Result<Mark>> + Send
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 a mark. Consequently, implementations
should ensure that the starting time is low enough to avoid the
possibility of overflow in practice.