Trait avr_oxide::devices::masterclock::DelayEvents

source ·
pub trait DelayEvents<'c> {
    type DelayHandle;

    // Required methods
    fn after_delay(
        &self,
        delay: Duration,
        bf: Box<dyn DelayCallback + 'c>
    ) -> Self::DelayHandle;
    fn cancel_delay(&self, handle: Self::DelayHandle) -> bool;
}
Expand description

Trait implemented by devices which can run code after a delay has passed.

Required Associated Types§

Required Methods§

source

fn after_delay( &self, delay: Duration, bf: Box<dyn DelayCallback + 'c> ) -> Self::DelayHandle

Call the given callback after /at least/ delay time has passed.

source

fn cancel_delay(&self, handle: Self::DelayHandle) -> bool

Cancel a given delay event, if possible. Returns true if the event was cancelled, or false if not (because it either never existed, or it has already been executed.)

Implementors§

source§

impl<'mc, T, S> DelayEvents<'mc> for MasterClock<'mc, T, S>
where T: 'static + TimerControl, S: EventSink,

§

type DelayHandle = DelayQueueHandle

source§

impl<'wc, T, S> DelayEvents<'wc> for WallClock<'wc, T, S>
where T: 'static + TimerControl + RtcTimerCalibration, S: EventSink,

§

type DelayHandle = DelayQueueHandle