Trait button_driver::instant::InstantProvider

source ·
pub trait InstantProvider<D = Duration>
where Self: Sub<Self, Output = D> + Clone,
{ // Required method fn now() -> Self; // Provided method fn elapsed(&self) -> D { ... } }
Expand description

An abstraction for retrieving the current time.

The underlying counter shell be monotonic in order for the crate to operate correctly.

Required Methods§

source

fn now() -> Self

Returns an instant corresponding to “now”.

Provided Methods§

source

fn elapsed(&self) -> D

Returns the amount of time elapsed since this instant.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl InstantProvider for Instant

source§

fn now() -> Self

Implementors§