Skip to main content

Crate horloge

Crate horloge 

Source
Expand description

Library for clock and clock abstractions.

This library provides traits representing an abstract clock.

  • NowOnce, NowMut, Now, these are specialized versions of the Fn* traits. They represent the operation to retrieve the current time.
  • SleepOnce, SleepMut, Sleep, these are specialized versions of the Fn* traits. They represent the operation to create a timer resolved at a later time.

This crate also provides aliases and utility traits.

  • ErasedSleep: Sleep variant returning an opaque boxed future.
  • StdClock, Chrono04Clock: high-level traits
  • NowExt: helper methods

Macros§

impl_now
impl_sleep

Structs§

SystemStdClock
Standard library clock using the system time.
SystemTokio1Chrono04Clock
Tokio clock with chrono types using the system time.
SystemTokio1StdClock
Tokio clock with std types using the system time.
VirtualClockState
VirtualStdClock
Monotic virtual clock using the standard Instant type.
VirtualTimer
VirtualTokio1Chrono04Clock
Tokio clock with chrono types using virtual time.
VirtualTokio1StdClock
Tokio clock with std types using virtual time.
VirtualTokio1StdClockState
VirtualTokio1StdTimer

Traits§

Chrono04Clock
Alias trait for ChronoNow + Clock
Chrono04Now
Trait for a source of the current time, as a chrono::DateTime<Utc>.
Duration
ErasedChrono04Clock
Alias trait for ChronoNow + ErasedClock
ErasedSleep
ErasedSleepMut
ErasedSleepOnce
Dyn-compatible version of Sleep.
ErasedStdClock
Alias trait for StdNow + ErasedClock
Monotonic
Marker trait indicating that a clock is monotonic.
Now
NowExt
NowMut
NowOnce
Trait for a source of the current time, as an abstract point in time.
Sleep
SleepMut
SleepOnce
Trait for types providing timers, enabling to “sleep”.
StdClock
Alias trait for StdNow + Clock
StdNow
Trait for a source of the current time, as a standard Instant.

Type Aliases§

SystemTokio1Chrono04Timer
Type alias for the timer type used by SystemTokio1Chrono04Clock for its Clock implementation.
SystemTokio1StdTimer
Type alias for the timer type used by SystemTokio1StdClock for its Clock implementation.