pub struct ClockUpdateBuilder<Val, Rate, Err, Ref, Out> { /* private fields */ }
Expand description
Builder to specify how zero or more properties of a clock should be updated.
See [Clock::update
].
A ClockUpdateBuilder
may be created using ClockUpdate::builder()
.
Implementations§
Source§impl<Val: ValueState<ReferenceTimeline = Ref, OutputTimeline = Out>, Rate: RateState, Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
impl<Val: ValueState<ReferenceTimeline = Ref, OutputTimeline = Out>, Rate: RateState, Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
Sourcepub fn build(self) -> ClockUpdate<Ref, Out>
pub fn build(self) -> ClockUpdate<Ref, Out>
Converts this ClockUpdateBuilder
to a ClockUpdate
.
Source§impl<Rate: RateState, Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Null<Ref, Out>, Rate, Err, Ref, Out>
impl<Rate: RateState, Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Null<Ref, Out>, Rate, Err, Ref, Out>
Sourcepub fn absolute_value(
self,
reference_value: Instant<Ref>,
synthetic_value: Instant<Out>,
) -> ClockUpdateBuilder<AbsoluteValue<Ref, Out>, Rate, Err, Ref, Out>
pub fn absolute_value( self, reference_value: Instant<Ref>, synthetic_value: Instant<Out>, ) -> ClockUpdateBuilder<AbsoluteValue<Ref, Out>, Rate, Err, Ref, Out>
Sets an absolute value for this ClockUpdate
using a (reference time, synthetic time) pair.
Reference time is typically monotonic and synthetic time is the time tracked by the clock. Adding an absolute value is only possible when no other value has been set.
Source§impl<Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Null<Ref, Out>, Null<Ref, Out>, Err, Ref, Out>
impl<Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Null<Ref, Out>, Null<Ref, Out>, Err, Ref, Out>
Sourcepub fn approximate_value(
self,
synthetic_value: Instant<Out>,
) -> ClockUpdateBuilder<ApproximateValue<Ref, Out>, Null<Ref, Out>, Err, Ref, Out>
pub fn approximate_value( self, synthetic_value: Instant<Out>, ) -> ClockUpdateBuilder<ApproximateValue<Ref, Out>, Null<Ref, Out>, Err, Ref, Out>
Sets an approximate value for this ClockUpdateBuilder
using a synthetic time only.
Synthetic time is the time tracked by the clock. The reference time will be set to current monotonic time when the kernel applies this clock update, meaning any delay between calculating synthetic time and applying the update will result in a clock error. Adding an approximate value is only possible when no other value has been set and when no rate has been set.
Source§impl<Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Null<Ref, Out>, Null<Ref, Out>, Err, Ref, Out>
impl<Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Null<Ref, Out>, Null<Ref, Out>, Err, Ref, Out>
Sourcepub fn rate_adjust(
self,
rate_adjust_ppm: i32,
) -> ClockUpdateBuilder<Null<Ref, Out>, Rate, Err, Ref, Out>
pub fn rate_adjust( self, rate_adjust_ppm: i32, ) -> ClockUpdateBuilder<Null<Ref, Out>, Rate, Err, Ref, Out>
Adds a rate change in parts per million to this ClockUpdateBuilder
.
Adding a rate is only possible when the value is either not set or set to an absolute value and when no rate has been set previously.
Source§impl<Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<AbsoluteValue<Ref, Out>, Null<Ref, Out>, Err, Ref, Out>
impl<Err: ErrorState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<AbsoluteValue<Ref, Out>, Null<Ref, Out>, Err, Ref, Out>
Sourcepub fn rate_adjust(
self,
rate_adjust_ppm: i32,
) -> ClockUpdateBuilder<AbsoluteValue<Ref, Out>, Rate, Err, Ref, Out>
pub fn rate_adjust( self, rate_adjust_ppm: i32, ) -> ClockUpdateBuilder<AbsoluteValue<Ref, Out>, Rate, Err, Ref, Out>
Adds a rate change in parts per million to this ClockUpdateBuilder
.
Adding a rate is only possible when the value is either not set or set to an absolute value and when no rate has been set previously.
Source§impl<Val: ValueState, Rate: RateState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Val, Rate, Null<Ref, Out>, Ref, Out>
impl<Val: ValueState, Rate: RateState, Ref: Timeline, Out: Timeline> ClockUpdateBuilder<Val, Rate, Null<Ref, Out>, Ref, Out>
Sourcepub fn error_bounds(
self,
error_bound_ns: u64,
) -> ClockUpdateBuilder<Val, Rate, Error, Ref, Out>
pub fn error_bounds( self, error_bound_ns: u64, ) -> ClockUpdateBuilder<Val, Rate, Error, Ref, Out>
Adds an error bound in nanoseconds to this ClockUpdateBuilder
.
Trait Implementations§
Source§impl<Val: Debug, Rate: Debug, Err: Debug, Ref: Debug, Out: Debug> Debug for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
impl<Val: Debug, Rate: Debug, Err: Debug, Ref: Debug, Out: Debug> Debug for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
Source§impl<Val: ValueState<ReferenceTimeline = Ref, OutputTimeline = Out>, Rate: RateState, Err: ErrorState, Ref: Timeline, Out: Timeline> From<ClockUpdateBuilder<Val, Rate, Err, Ref, Out>> for ClockUpdate<Ref, Out>
impl<Val: ValueState<ReferenceTimeline = Ref, OutputTimeline = Out>, Rate: RateState, Err: ErrorState, Ref: Timeline, Out: Timeline> From<ClockUpdateBuilder<Val, Rate, Err, Ref, Out>> for ClockUpdate<Ref, Out>
Source§fn from(builder: ClockUpdateBuilder<Val, Rate, Err, Ref, Out>) -> Self
fn from(builder: ClockUpdateBuilder<Val, Rate, Err, Ref, Out>) -> Self
Source§impl<Val: PartialEq, Rate: PartialEq, Err: PartialEq, Ref: PartialEq, Out: PartialEq> PartialEq for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
impl<Val: PartialEq, Rate: PartialEq, Err: PartialEq, Ref: PartialEq, Out: PartialEq> PartialEq for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
Source§fn eq(&self, other: &ClockUpdateBuilder<Val, Rate, Err, Ref, Out>) -> bool
fn eq(&self, other: &ClockUpdateBuilder<Val, Rate, Err, Ref, Out>) -> bool
self
and other
values to be equal, and is used by ==
.