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).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more