Skip to main content

Module clock

Module clock 

Source
Expand description

The SystemClock abstraction over reading/setting a system wall clock.

This module has no OS or std dependency, so bare-metal/kernel consumers can implement SystemClock themselves (e.g. against a hypervisor RTC) without pulling in libc or enabling the os-clock feature. The concrete Linux implementation lives in [crate::os_clock::linux], behind the os-clock feature.

Structs§

Time
A point in time expressed as whole seconds and nanoseconds since the Unix epoch.

Enums§

ClockError
Errors from reading or setting the system/OS clock.

Traits§

SystemClock
Abstraction over reading/setting a system wall clock.

Functions§

enforce_floor
Reads C’s current time and, if it predates the crate’s anti-rollback floor, sets it forward to the floor.