EventLoop

Trait EventLoop 

Source
pub trait EventLoop {
    // Required methods
    fn poll<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Event> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_last_will(&mut self, will: LastWill);
}
Expand description

A trait for implementing a type that acts as a Sparkplug Client’s EventLoop

Required Methods§

Source

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

Poll the EventLoop for an event Continuing to poll will reconnect if there is a disconnection. NOTE Don’t block this while iterating

Source

fn set_last_will(&mut self, will: LastWill)

Set the last will to be used on the next connection

Implementors§