Trait netstack3_core::context::InstantContext
source · pub trait InstantContext {
type Instant: Instant + 'static;
// Required method
fn now(&self) -> Self::Instant;
}
Expand description
A context that provides access to a monotonic clock.
Required Associated Types§
sourcetype Instant: Instant + 'static
type Instant: Instant + 'static
The type of an instant in time.
All time is measured using Instant
s, including scheduling timers
through TimerContext
. This type may represent some sort of
real-world time (e.g., [std::time::Instant
]), or may be faked in
testing using a fake clock.