[−][src]Struct lpc82x_hal::clock::Ticks
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(&self) -> Self
[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,
C: Sync,
impl<'clock, C> Sync for Ticks<'clock, C> where
C: Sync,
C: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,