[][src]Struct cortex_m_systick_countdown::MillisCountDown

pub struct MillisCountDown<'a, CM: CountsMillis> { /* fields omitted */ }

CountDown that uses an underlying CountsMillis (probably PollingSysTick).

Methods

impl<'a, CM: CountsMillis> MillisCountDown<'a, CM>[src]

pub fn new(counter: &'a CM) -> Self[src]

Creates a MillisCountDown from a CountsMillis source.

CountsMillis is probably going to be your instance of PollingSysTick.

pub fn start_ms(&mut self, ms: u32)[src]

Underlying version of CountDown’s start that takes a u32 of milliseconds rather than a Duration.

Use this if you want to avoid the u64s in Duration.

pub fn wait_ms(&mut self) -> Result<(), Error<Void>>[src]

Underlying implementation of CountDown’s wait that works directly on our underlying u32 ms values and can be used by any CountDown trait implementations.

Calling this method before start, or after it has already returned Ok will panic.

Trait Implementations

impl<'a, CM: CountsMillis> CountDown for MillisCountDown<'a, CM>[src]

type Time = Duration

The unit of time used by this timer

fn start<T>(&mut self, count: T) where
    T: Into<Self::Time>, 
[src]

Starts timing the given Duration.

wait will return nb::Error::WouldBlock until this amount of time has passed.

Calling this method before the time has fully ellapsed will reset the timer.

fn wait(&mut self) -> Result<(), Error<Void>>[src]

Returns nb::Error::WillBlock while the timer runs, then will return Result::Ok.

Calling this method before start, or after it has already returned Ok will panic.

Auto Trait Implementations

impl<'a, CM> Unpin for MillisCountDown<'a, CM>

impl<'a, CM> Sync for MillisCountDown<'a, CM> where
    CM: Sync

impl<'a, CM> Send for MillisCountDown<'a, CM> where
    CM: Sync

Blanket Implementations

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

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self