pub struct Transform<Reference, Output> {
pub reference_offset: Instant<Reference>,
pub synthetic_offset: Instant<Output>,
pub rate_adjust_ppm: i32,
pub error_bound_at_offset: u64,
pub error_bound_growth_ppm: u32,
}
Expand description
A transformation from monotonic time to synthetic time, including an error bound on this synthetic time.
Fields§
§reference_offset: Instant<Reference>
An offset on the monotonic timeline in nanoseconds.
synthetic_offset: Instant<Output>
An offset on the synthetic timeline in nanoseconds.
rate_adjust_ppm: i32
An adjustment to the standard 1 monotonic tick:1 synthetic tick rate in parts per million. Positive values indicate the synthetic clock is moving faster than the monotonic clock.
error_bound_at_offset: u64
The error bound on synthetic clock at monotonic = monotonic_offset.
error_bound_growth_ppm: u32
The growth in error bound per monotonic tick in parts per million.
Implementations§
source§impl<Reference: Timeline + Copy, Output: Timeline + Copy> Transform<Reference, Output>
impl<Reference: Timeline + Copy, Output: Timeline + Copy> Transform<Reference, Output>
sourcepub fn synthetic(&self, reference: Instant<Reference>) -> Instant<Output>
pub fn synthetic(&self, reference: Instant<Reference>) -> Instant<Output>
Returns the synthetic time at the supplied monotonic time.
sourcepub fn error_bound(&self, reference: Instant<Reference>) -> u64
pub fn error_bound(&self, reference: Instant<Reference>) -> u64
Returns the error bound at the supplied monotonic time.
sourcepub fn difference(
&self,
other: &Self,
reference: Instant<Reference>,
) -> Duration<Output>
pub fn difference( &self, other: &Self, reference: Instant<Reference>, ) -> Duration<Output>
Returns the synthetic time on this Transform
minus the synthetic time on other
,
calculated at the supplied monotonic time.
sourcepub fn jump_to(
&self,
reference: Instant<Reference>,
) -> ClockUpdate<Reference, Output>
pub fn jump_to( &self, reference: Instant<Reference>, ) -> ClockUpdate<Reference, Output>
Returns a ClockUpdate
that will set a Clock
onto this Transform
using data
from the supplied monotonic time.
Trait Implementations§
source§impl<Reference: Timeline, Output: Timeline> From<&Clock<Reference, Output>> for Transform<Reference, Output>
impl<Reference: Timeline, Output: Timeline> From<&Clock<Reference, Output>> for Transform<Reference, Output>
source§impl<Reference: PartialEq, Output: PartialEq> PartialEq for Transform<Reference, Output>
impl<Reference: PartialEq, Output: PartialEq> PartialEq for Transform<Reference, Output>
impl<Reference: Eq, Output: Eq> Eq for Transform<Reference, Output>
impl<Reference, Output> StructuralPartialEq for Transform<Reference, Output>
Auto Trait Implementations§
impl<Reference, Output> Freeze for Transform<Reference, Output>
impl<Reference, Output> RefUnwindSafe for Transform<Reference, Output>where
Reference: RefUnwindSafe,
Output: RefUnwindSafe,
impl<Reference, Output> Send for Transform<Reference, Output>
impl<Reference, Output> Sync for Transform<Reference, Output>
impl<Reference, Output> Unpin for Transform<Reference, Output>
impl<Reference, Output> UnwindSafe for Transform<Reference, Output>where
Reference: UnwindSafe,
Output: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)