Struct paho_mqtt3as_sys::MQTTAsync_message [] [src]

#[repr(C)]
pub struct MQTTAsync_message { pub struct_id: [c_char; 4], pub struct_version: c_int, pub payloadlen: c_int, pub payload: *mut c_void, pub qos: c_int, pub retained: c_int, pub dup: c_int, pub msgid: c_int, }

A structure representing the payload and attributes of an MQTT message. The message topic is not part of this structure (see MQTTAsync_publishMessage(), MQTTAsync_publish(), MQTTAsync_receive(), MQTTAsync_freeMessage() and MQTTAsync_messageArrived()).

Fields

The eyecatcher for this structure. must be MQTM.

The version number of this structure. Must be 0

The length of the MQTT message payload in bytes.

A pointer to the payload of the MQTT message.

The quality of service (QoS) assigned to the message. There are three levels of QoS:

QoS0
Fire and forget - the message may not be delivered
QoS1
At least once - the message will be delivered, but may be delivered more than once in some circumstances.
QoS2
Once and one only - the message will be delivered exactly once.

The retained flag serves two purposes depending on whether the message it is associated with is being published or received.

retained = true
For messages being published, a true setting indicates that the MQTT server should retain a copy of the message. The message will then be transmitted to new subscribers to a topic that matches the message topic. For subscribers registering a new subscription, the flag being true indicates that the received message is not a new one, but one that has been retained by the MQTT server.

retained = false
For publishers, this ndicates that this message should not be retained by the MQTT server. For subscribers, a false setting indicates this is a normal message, received as a result of it being published to the server.

The dup flag indicates whether or not this message is a duplicate. It is only meaningful when receiving QoS1 messages. When true, the client application should take appropriate action to deal with the duplicate message.

The message identifier is normally reserved for internal use by the MQTT client and server.

Trait Implementations

impl Debug for MQTTAsync_message
[src]

Formats the value using the given formatter.

impl Copy for MQTTAsync_message
[src]

impl Clone for MQTTAsync_message
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for MQTTAsync_message
[src]

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