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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)