[−][src]Struct embedded_async_timer::AsyncTimer
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]
&'a self,
dur: T::Duration
) -> Result<Delay<'a, T>, CapacityError>
Wait at least for a specific duration.
pub async fn wait_until<'a>(
&'a self,
deadline: T::Instant
) -> Result<(), CapacityError>
[src]
&'a self,
deadline: T::Instant
) -> Result<(), CapacityError>
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]
&'a self,
deadline: T::Instant
) -> Result<Delay<'a, T>, CapacityError>
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,
T: Send,
<T as Timer>::Instant: Send,
impl<T> Sync for AsyncTimer<T> where
T: Send,
<T as Timer>::Instant: Send,
T: Send,
<T as Timer>::Instant: Send,
impl<T> Unpin for AsyncTimer<T> where
T: Unpin,
<T as Timer>::Instant: Unpin,
T: Unpin,
<T as Timer>::Instant: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
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<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,