Trait SensorHandler

Source
pub trait SensorHandler:
    Send
    + Sync
    + Debug {
    // Required methods
    fn handle_reading<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        reading: &'life1 SensorMessage,
        context: &'life2 Value,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_name(&self) -> &str;
    fn is_enabled(&self) -> bool;
}

Required Methods§

Source

fn handle_reading<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, reading: &'life1 SensorMessage, context: &'life2 Value, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Publishes the given reading to the target.

Source

fn get_name(&self) -> &str

Returns the name of the handler.

Source

fn is_enabled(&self) -> bool

Returns whether or not the handler is enabled.

Implementors§