Struct zx::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

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

§

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.