pub struct ClockSynchronization<A: Time, B: Time> { /* private fields */ }Expand description
A pair of instants from two clocks that correspond to roughly the same point in time.
Implementations§
Source§impl<A: Time, B: Time> ClockSynchronization<A, B>
impl<A: Time, B: Time> ClockSynchronization<A, B>
Sourcepub fn new(epoch_a: A::Instant, epoch_b: B::Instant) -> Self
pub fn new(epoch_a: A::Instant, epoch_b: B::Instant) -> Self
Creates a synchronization from a known pair of corresponding instants.
Sourcepub fn new_aba_calibrated<CA, CB>(a: &CalibratedClock<CA>, b: &CB) -> Self
pub fn new_aba_calibrated<CA, CB>(a: &CalibratedClock<CA>, b: &CB) -> Self
Creates a synchronization by sampling both clocks in an A-B-A pattern.
Multiple measurements are performed and the one with least error is selected.
Sourcepub fn to_a<CA, CB>(&self, t: B::Instant, a: &CA, b: &CB) -> A::Instant
pub fn to_a<CA, CB>(&self, t: B::Instant, a: &CA, b: &CB) -> A::Instant
Converts an instant from clock B’s domain to clock A’s domain.
Works for instants both before and after the synchronization epoch.
Sourcepub fn to_b<CA, CB>(&self, t: A::Instant, a: &CA, b: &CB) -> B::Instant
pub fn to_b<CA, CB>(&self, t: A::Instant, a: &CA, b: &CB) -> B::Instant
Converts an instant from clock A’s domain to clock B’s domain.
Works for instants both before and after the synchronization epoch.
Trait Implementations§
impl<A: Time, B: Time> Copy for ClockSynchronization<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for ClockSynchronization<A, B>
impl<A, B> RefUnwindSafe for ClockSynchronization<A, B>
impl<A, B> Send for ClockSynchronization<A, B>
impl<A, B> Sync for ClockSynchronization<A, B>
impl<A, B> Unpin for ClockSynchronization<A, B>
impl<A, B> UnsafeUnpin for ClockSynchronization<A, B>
impl<A, B> UnwindSafe for ClockSynchronization<A, B>
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