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 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Discipline
impl RefUnwindSafe for Discipline
impl Send for Discipline
impl Sync for Discipline
impl Unpin for Discipline
impl UnsafeUnpin for Discipline
impl UnwindSafe for Discipline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more