Struct paho_mqtt::message::Message [] [src]

pub struct Message {
    pub cmsg: MQTTAsync_message,
    pub topic: CString,
    // some fields omitted
}

A Message represents all the information passed in an MQTT PUBLISH packet. This is the primary data transfer mechanism.

Fields

Methods

impl Message
[src]

Creates a new message.

Arguments

  • topic The topic on which the message is published.
  • payload The binary payload of the message
  • qos The quality of service for message delivery (0, 1, or 2)

Creates a new message that will be retained by the broker. This creates a message with the 'retained' flag set.

Arguments

  • topic The topic on which the message is published.
  • payload The binary payload of the message
  • qos The quality of service for message delivery (0, 1, or 2)

Creates a new message from C language components.

Arguments

  • topic The topic on which the message is published.
  • msg The message struct from the C library

Gets the topic for the message. Note that this copies the topic.

Gets the payload of the message. This returns the payload as a binary vector.

Gets the payload of the message as a string. Note that this clones the payload.

Returns the Quality of Service (QOS) for the message.

Gets the 'retained' flag for the message.

Trait Implementations

impl Debug for Message
[src]

Formats the value using the given formatter.

impl Default for Message
[src]

Returns the "default value" for a type. Read more

impl Clone for Message
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a, 'b> From<(&'a str, &'b [u8])> for Message
[src]

Performs the conversion.

impl<'a, 'b> From<(&'a str, &'b [u8], i32, bool)> for Message
[src]

Performs the conversion.