pub struct Discipline { /* private fields */ }Implementations§
Source§impl Discipline
impl Discipline
pub fn new(cfg: DisciplineConfig) -> Self
pub fn poll_log2(&self) -> i8
Sourcepub fn on_estimate(
&mut self,
offset: f64,
freq_ppm_meas: Option<f64>,
offset_sd: f64,
) -> Plan
pub fn on_estimate( &mut self, offset: f64, freq_ppm_meas: Option<f64>, offset_sd: f64, ) -> Plan
Feed the latest combined estimate.
offset— seconds to add to the local clock, now.freq_ppm_meas— residual frequency error from the regression (ppm, positive = local slow), if trusted.offset_sd— residual noise of the estimate.
Sourcepub fn on_estimate_with_leap(
&mut self,
offset: f64,
freq_ppm_meas: Option<f64>,
offset_sd: f64,
leap_pending: bool,
) -> Plan
pub fn on_estimate_with_leap( &mut self, offset: f64, freq_ppm_meas: Option<f64>, offset_sd: f64, leap_pending: bool, ) -> Plan
As Discipline::on_estimate, told whether the source has announced a
leap second for the current UTC day.
Sourcepub fn retry_interval_s(&self) -> f64
pub fn retry_interval_s(&self) -> f64
How long to wait before trying again when an exchange yields nothing — lost, or rejected because the server was not yet usable.
This is the iburst spacing while the burst budget lasts, not the poll interval. A server that has only just started answers its first requests with the unsynchronised leap indicator, which a client must refuse; if that refusal then costs a full poll interval, a cold start is delayed by 16 seconds before the first usable sample. Measured against chrony under clknetsim, that single wait was most of an 8x convergence gap.
Nothing is consumed here: a failed exchange must not spend burst budget, or a few early losses would silently end the burst.
Trait Implementations§
Source§impl Clone for Discipline
impl Clone for Discipline
Source§fn clone(&self) -> Discipline
fn clone(&self) -> Discipline
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more