zx

Struct ClockUpdateBuilder

Source
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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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>

Source§

fn from(builder: ClockUpdateBuilder<Val, Rate, Err, Ref, Out>) -> Self

Converts to this type from the input type.
Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Val: Eq, Rate: Eq, Err: Eq, Ref: Eq, Out: Eq> Eq for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>

Source§

impl<Val, Rate, Err, Ref, Out> StructuralPartialEq for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>

Auto Trait Implementations§

§

impl<Val, Rate, Err, Ref, Out> Freeze for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
where Val: Freeze, Rate: Freeze, Err: Freeze,

§

impl<Val, Rate, Err, Ref, Out> RefUnwindSafe for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>

§

impl<Val, Rate, Err, Ref, Out> Send for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
where Val: Send, Rate: Send, Err: Send, Ref: Send, Out: Send,

§

impl<Val, Rate, Err, Ref, Out> Sync for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
where Val: Sync, Rate: Sync, Err: Sync, Ref: Sync, Out: Sync,

§

impl<Val, Rate, Err, Ref, Out> Unpin for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
where Val: Unpin, Rate: Unpin, Err: Unpin, Ref: Unpin, Out: Unpin,

§

impl<Val, Rate, Err, Ref, Out> UnwindSafe for ClockUpdateBuilder<Val, Rate, Err, Ref, Out>
where Val: UnwindSafe, Rate: UnwindSafe, Err: UnwindSafe, Ref: UnwindSafe, Out: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.