[−][src]Struct cortex_m_systick_countdown::MillisCountDown
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 u64
s 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]
T: Into<Self::Time>,
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,
CM: Sync,
impl<'a, CM> Send for MillisCountDown<'a, CM> where
CM: Sync,
CM: Sync,
Blanket Implementations
impl<T, U> TryFrom<U> 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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> 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,
impl<T> Same<T> for T
type Output = T
Should always be Self