pub struct ClockUpdateBuilder<V: ValueState, R: RateState, E: ErrorState> { /* 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<V: ValueState, R: RateState, E: ErrorState> ClockUpdateBuilder<V, R, E>

source

pub fn build(self) -> ClockUpdate

Converts this ClockUpdateBuilder to a ClockUpdate.

source§

impl<R: RateState, E: ErrorState> ClockUpdateBuilder<Null, R, E>

source

pub fn absolute_value( self, reference_value: Time, synthetic_value: Time ) -> ClockUpdateBuilder<AbsoluteValue, R, E>

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<E: ErrorState> ClockUpdateBuilder<Null, Null, E>

source

pub fn approximate_value( self, synthetic_value: Time ) -> ClockUpdateBuilder<ApproximateValue, Null, E>

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<E: ErrorState> ClockUpdateBuilder<Null, Null, E>

source

pub fn rate_adjust( self, rate_adjust_ppm: i32 ) -> ClockUpdateBuilder<Null, Rate, E>

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<E: ErrorState> ClockUpdateBuilder<AbsoluteValue, Null, E>

source

pub fn rate_adjust( self, rate_adjust_ppm: i32 ) -> ClockUpdateBuilder<AbsoluteValue, Rate, E>

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<V: ValueState, R: RateState> ClockUpdateBuilder<V, R, Null>

source

pub fn error_bounds( self, error_bound_ns: u64 ) -> ClockUpdateBuilder<V, R, Error>

Adds an error bound in nanoseconds to this ClockUpdateBuilder.

Trait Implementations§

source§

impl<V: Debug + ValueState, R: Debug + RateState, E: Debug + ErrorState> Debug for ClockUpdateBuilder<V, R, E>

source§

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

Formats the value using the given formatter. Read more
source§

impl<V: ValueState, R: RateState, E: ErrorState> From<ClockUpdateBuilder<V, R, E>> for ClockUpdate

source§

fn from(builder: ClockUpdateBuilder<V, R, E>) -> Self

Converts to this type from the input type.
source§

impl<V: PartialEq + ValueState, R: PartialEq + RateState, E: PartialEq + ErrorState> PartialEq for ClockUpdateBuilder<V, R, E>

source§

fn eq(&self, other: &ClockUpdateBuilder<V, R, E>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<V: Eq + ValueState, R: Eq + RateState, E: Eq + ErrorState> Eq for ClockUpdateBuilder<V, R, E>

source§

impl<V: ValueState, R: RateState, E: ErrorState> StructuralPartialEq for ClockUpdateBuilder<V, R, E>

Auto Trait Implementations§

§

impl<V, R, E> Freeze for ClockUpdateBuilder<V, R, E>
where E: State + Freeze, R: State + Freeze, V: State + Freeze,

§

impl<V, R, E> RefUnwindSafe for ClockUpdateBuilder<V, R, E>
where E: State + RefUnwindSafe, R: State + RefUnwindSafe, V: State + RefUnwindSafe,

§

impl<V, R, E> Send for ClockUpdateBuilder<V, R, E>
where E: State + Send, R: State + Send, V: State + Send,

§

impl<V, R, E> Sync for ClockUpdateBuilder<V, R, E>
where E: State + Sync, R: State + Sync, V: State + Sync,

§

impl<V, R, E> Unpin for ClockUpdateBuilder<V, R, E>
where E: State + Unpin, R: State + Unpin, V: State + Unpin,

§

impl<V, R, E> UnwindSafe for ClockUpdateBuilder<V, R, E>
where E: State + UnwindSafe, R: State + UnwindSafe, V: State + 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>,

§

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

§

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.