pub struct VirtualClock { /* private fields */ }Implementations§
Source§impl VirtualClock
impl VirtualClock
pub fn new() -> Self
Sourcepub fn update(
&mut self,
mono: f64,
offset: f64,
skew_ppm: Option<f64>,
error_bound: f64,
)
pub fn update( &mut self, mono: f64, offset: f64, skew_ppm: Option<f64>, error_bound: f64, )
Feed a fresh measurement.
mono— monotonic seconds now.offset— seconds to ADD to the raw wall clock, measured now.skew_ppm— raw clock frequency error if known.error_bound— measurement error, seconds.
Sourcepub fn now(&mut self, mono: f64, raw_wall: f64) -> f64
pub fn now(&mut self, mono: f64, raw_wall: f64) -> f64
Corrected wall time. raw_wall is the platform clock reading at the same
instant mono was read.
Sourcepub fn confidence(&self, mono: f64) -> f64
pub fn confidence(&self, mono: f64) -> f64
Current error bound, seconds — grows while no updates arrive. INFINITY
until the first update: callers gate decisions on this, so it must not
pretend precision it does not have.
pub fn is_synchronized(&self) -> bool
Trait Implementations§
Source§impl Clone for VirtualClock
impl Clone for VirtualClock
Source§fn clone(&self) -> VirtualClock
fn clone(&self) -> VirtualClock
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 moreimpl Copy for VirtualClock
Source§impl Debug for VirtualClock
impl Debug for VirtualClock
Auto Trait Implementations§
impl Freeze for VirtualClock
impl RefUnwindSafe for VirtualClock
impl Send for VirtualClock
impl Sync for VirtualClock
impl Unpin for VirtualClock
impl UnsafeUnpin for VirtualClock
impl UnwindSafe for VirtualClock
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