pub struct ClockErrorBoundV2 { /* private fields */ }Expand description
Structure that holds the ClockErrorBound data captured at a specific point in time and valid
until a subsequent point in time.
The ClockErrorBound structure supports calculating the actual bound on clock error at any time,
using its now() method. The internal fields are not meant to be accessed directly.
Note that the timestamps in between which this ClockErrorBound data is valid are captured using
a CLOCK_MONOTONIC_COARSE clock. The monotonic clock id is required to correctly measure the
duration during which clock drift possibly accrues, and avoid events when the clock is set,
smeared or affected by leap seconds.
The structure is shared across the Shared Memory segment and has a C representation to enforce this specific layout.
Implementations§
Source§impl ClockErrorBoundV2
impl ClockErrorBoundV2
Sourcepub fn new(
as_of: TimeSpec,
void_after: TimeSpec,
bound_nsec: i64,
disruption_marker: u64,
max_drift_ppb: u32,
clock_status: ClockStatus,
clock_disruption_support_enabled: bool,
) -> ClockErrorBoundV2
pub fn new( as_of: TimeSpec, void_after: TimeSpec, bound_nsec: i64, disruption_marker: u64, max_drift_ppb: u32, clock_status: ClockStatus, clock_disruption_support_enabled: bool, ) -> ClockErrorBoundV2
Create a new ClockErrorBound struct.
Sourcepub fn now(&self) -> Result<ClockBoundNowResult, ShmError>
pub fn now(&self) -> Result<ClockBoundNowResult, ShmError>
The ClockErrorBoundV2 implementation of now(), a clock_gettime() equivalent but with
bound on clock accuracy.
Returns a pair of (earliest, latest) timespec between which current time exists. The interval width is twice the clock error bound (ceb) such that: (earliest, latest) = ((now - ceb), (now + ceb)) The function also returns a clock status to assert that the clock is being synchronized, or free-running, or …