Struct Message
pub struct Message {
pub topic: TopicBuf,
pub payload: Vec<u8>,
pub qos: QoS,
pub retain: bool,
pub content_type: Option<MqttString>,
pub response_topic: Option<TopicBuf>,
pub correlation_data: Option<MqttBytesBuf>,
pub message_expiry: Option<u32>,
pub payload_utf8: Option<bool>,
pub subscription_ids: Vec<NonZeroVbi>,
pub user_properties: Vec<(MqttString, MqttString)>,
}Expand description
An incoming MQTT v5 message from the broker.
Contains the standard PUBLISH fields plus all applicable v5 properties extracted from the packet.
Fields§
§topic: TopicBufTopic the message was published to.
payload: Vec<u8>Message payload bytes.
qos: QoSQuality of Service level of the delivered message.
retain: boolWhether the message was retained by the broker.
content_type: Option<MqttString>MIME content type of the payload (property 0x03).
response_topic: Option<TopicBuf>Topic the receiver should use for responses (property 0x08).
correlation_data: Option<MqttBytesBuf>Correlation data for request/response flows (property 0x09).
message_expiry: Option<u32>Remaining lifetime of the message in seconds (property 0x02).
payload_utf8: Option<bool>Payload format: true = UTF-8, false = unspecified (property 0x01).
subscription_ids: Vec<NonZeroVbi>Subscription identifiers that caused this delivery (property 0x0B).
Multiple identifiers are possible when overlapping subscriptions match the same topic.
user_properties: Vec<(MqttString, MqttString)>User-defined key-value properties (property 0x26).