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.