[][src]Struct embedded_async_timer::AsyncTimer

pub struct AsyncTimer<T: Timer>(_);

A wrapped timer that can asynchronously wake up for concurrent deadlines.

The capacity of this timer is determined by the internal PriorityQueue.

Implementations

impl<T: Timer> AsyncTimer<T>[src]

pub fn new(timer: T) -> Self[src]

pub fn reset(&self)[src]

pub fn now(&self) -> T::Instant[src]

pub unsafe fn get_inner<U>(&self, f: impl FnOnce(&mut T) -> U) -> U[src]

pub fn awaken(&self)[src]

Awaken all timers for which the deadline has passed compared to the time.

Will re-arm the inner RTC with the earliest deadline, if there is one.

Note: call this in the appropriate interrupt handler.

pub fn wait<'a>(
    &'a self,
    dur: T::Duration
) -> Result<Delay<'a, T>, CapacityError>
[src]

Wait at least for a specific duration.

pub async fn wait_until<'a>(
    &'a self,
    deadline: T::Instant
) -> Result<(), CapacityError>
[src]

Wait until some time after a specific deadline.

Will immediately return (and never yield) if the deadline has already passed.

pub fn wait_until_always<'a>(
    &'a self,
    deadline: T::Instant
) -> Result<Delay<'a, T>, CapacityError>
[src]

Wait until some time after a specific deadline.

Will at least yield once, even if the deadline has already passed.

Auto Trait Implementations

impl<T> Send for AsyncTimer<T> where
    T: Send,
    <T as Timer>::Instant: Send

impl<T> Sync for AsyncTimer<T> where
    T: Send,
    <T as Timer>::Instant: Send

impl<T> Unpin for AsyncTimer<T> where
    T: Unpin,
    <T as Timer>::Instant: Unpin

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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