[][src]Struct lpc82x_hal::clock::Ticks

pub struct Ticks<'clock, C: 'clock> {
    pub value: u32,
    pub clock: &'clock C,
}

Represents a number of ticks of a given clock

This struct is used to represent an amount of time, a duration, but in a low-level way that hardware peripherals can understand and handle. It is meant to be a common denominator that higher-level time APIs can be built on top of.

Fields

value: u32

The number of ticks

clock: &'clock C

Reference to the clock

For many clocks, it's possible to change their frequency. If this were to be done after an instance of Ticks had been created, that would invalidate the Ticks instance, as the same number of ticks would suddenly represent a different duration of time.

This reference exists to prevent this. Any change to the configuration of a clock would presumably require a mutable reference, which means as long as this shared reference to the clock exists, the compiler will prevent the clock frequency from being changed.

Trait Implementations

impl<'clock, Clock> Copy for Ticks<'clock, Clock>[src]

impl<'clock, Clock> Clone for Ticks<'clock, Clock>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'clock, C> Send for Ticks<'clock, C> where
    C: Sync

impl<'clock, C> Sync for Ticks<'clock, C> where
    C: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]