pub struct SyncController { /* private fields */ }Expand description
One source driving one clock — the single-source case, and the type the simulator and every existing caller use.
A thin facade over MultiController with exactly one register, so there
is one implementation of the loop rather than two that can drift apart.
Implementations§
Source§impl SyncController
impl SyncController
pub fn new(config: DisciplineConfig) -> Self
Sourcepub fn on_sample(&mut self, mono_now_s: f64, sample: Sample) -> ControllerStep
pub fn on_sample(&mut self, mono_now_s: f64, sample: Sample) -> ControllerStep
Feed one completed exchange and get the resulting plan.
mono_now_s is the local monotonic clock; sample.t should be the
exchange midpoint on that same timescale.
Sourcepub fn on_sample_with_leap(
&mut self,
mono_now_s: f64,
sample: Sample,
leap_pending: bool,
) -> ControllerStep
pub fn on_sample_with_leap( &mut self, mono_now_s: f64, sample: Sample, leap_pending: bool, ) -> ControllerStep
As SyncController::on_sample, told whether the source has announced
a leap second for the current UTC day.
pub fn revert_last_plan(&mut self) -> bool
pub fn confirm_last_plan(&mut self)
pub fn freq_ppm(&self) -> f64
pub fn drain_ppm(&self) -> f64
pub fn applied_ppm(&self) -> f64
pub fn poll_log2(&self) -> i8
pub fn samples(&self) -> usize
pub fn preload_frequency(&mut self, freq_ppm: f64)
pub fn retry_interval_s(&self) -> f64
pub fn drain_completes_at(&self) -> Option<f64>
pub fn poll_drain(&mut self, mono_now_s: f64) -> Option<ClockCommand>
Auto Trait Implementations§
impl Freeze for SyncController
impl RefUnwindSafe for SyncController
impl Send for SyncController
impl Sync for SyncController
impl Unpin for SyncController
impl UnsafeUnpin for SyncController
impl UnwindSafe for SyncController
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