Trait FromMqttMessage

Source
pub trait FromMqttMessage<T, DE> {
    // Required method
    fn from_mqtt_message(
        topic: Arc<TopicMatch>,
        payload: T,
    ) -> Result<Self, MessageConversionError<DE>>
       where Self: Sized;
}
Expand description

Trait for converting MQTT messages into structured types.

Typically implemented via #[mqtt_topic] macro for automatic topic parameter extraction.

Required Methods§

Source

fn from_mqtt_message( topic: Arc<TopicMatch>, payload: T, ) -> Result<Self, MessageConversionError<DE>>
where Self: Sized,

Convert MQTT topic and payload into a structured message

Implementors§