Trait WatchdogCallback

Source
pub trait WatchdogCallback: Send + Sync {
    // Required method
    fn on_timeout<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for responding to watchdog timeouts.

Implement this trait whenever you want to respond to watchdog timeouts, then pass your instance to add_callback() on the WatchdogPlatform trait.

Required Methods§

Source

fn on_timeout<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when the watchdog timer expires

Implementors§

Source§

impl<F> WatchdogCallback for F
where F: FnMut() + Send + Sync,

Blanket implementation of WatchdogCallback for closures.

This allows you to pass simple closures directly as callbacks without needing to create a struct.