pub enum ClockSource {
Monotonic,
Boottime,
MonotonicRaw,
}Expand description
Kernel clock backing stall-threshold accounting.
Wire-format and observer semantics are unchanged; only the kernel clock that drives “now_ns” is configurable.
Variants§
Monotonic
CLOCK_MONOTONIC — pauses on system suspend. SRE default,
available on every supported platform.
Boottime
CLOCK_BOOTTIME (Linux only) — advances through suspend.
Medical / embedded deployment.
MonotonicRaw
CLOCK_MONOTONIC_RAW (macOS / iOS only) — backed by
mach_continuous_time; advances through sleep. Darwin equivalent
of Linux’s Boottime. Rejected at startup on non-Darwin targets.
Implementations§
Source§impl ClockSource
Numeric tag used by the self-watchdog static CLOCK_SOURCE: AtomicU8
in main.rs to communicate the chosen source to the background
watchdog thread without an Arc.
impl ClockSource
Numeric tag used by the self-watchdog static CLOCK_SOURCE: AtomicU8
in main.rs to communicate the chosen source to the background
watchdog thread without an Arc.
Sourcepub fn as_u8(self) -> u8
pub fn as_u8(self) -> u8
0 → Monotonic, 1 → Boottime, 2 → MonotonicRaw. Stable across
versions; only ever produced by as_u8 on the same enum.
Sourcepub fn from_u8(byte: u8) -> Self
pub fn from_u8(byte: u8) -> Self
Inverse of Self::as_u8; unknown values fall back to Monotonic
(defensive — the only writer is as_u8 on the same enum).
Trait Implementations§
Source§impl Clone for ClockSource
impl Clone for ClockSource
Source§fn clone(&self) -> ClockSource
fn clone(&self) -> ClockSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClockSource
impl Debug for ClockSource
Source§impl Default for ClockSource
impl Default for ClockSource
Source§fn default() -> ClockSource
fn default() -> ClockSource
Source§impl Display for ClockSource
impl Display for ClockSource
Source§impl FromStr for ClockSource
impl FromStr for ClockSource
Source§impl PartialEq for ClockSource
impl PartialEq for ClockSource
Source§fn eq(&self, other: &ClockSource) -> bool
fn eq(&self, other: &ClockSource) -> bool
self and other values to be equal, and is used by ==.