Enum mqtt::Packet
[−]
[src]
pub enum Packet<'a> { Connect { protocol: Protocol, clean_session: bool, keep_alive: u16, last_will: Option<LastWill<'a>>, client_id: &'a str, username: Option<&'a str>, password: Option<&'a [u8]>, }, ConnectAck { session_present: bool, return_code: ConnectReturnCode, }, Publish { dup: bool, retain: bool, qos: QoS, topic: &'a str, packet_id: Option<u16>, payload: &'a [u8], }, PublishAck { packet_id: u16, }, PublishReceived { packet_id: u16, }, PublishRelease { packet_id: u16, }, PublishComplete { packet_id: u16, }, Subscribe { packet_id: u16, topic_filters: Vec<(&'a str, QoS)>, }, SubscribeAck { packet_id: u16, status: Vec<SubscribeReturnCode>, }, Unsubscribe { packet_id: u16, topic_filters: Vec<&'a str>, }, UnsubscribeAck { packet_id: u16, }, PingRequest, PingResponse, Disconnect, }
MQTT Control Packets
Variants
Connect
Client request to connect to Server
Fields of Connect
protocol: Protocol | |
clean_session: bool | the handling of the Session state. |
keep_alive: u16 | a time interval measured in seconds. |
last_will: Option<LastWill<'a>> | Will Message be stored on the Server and associated with the Network Connection. |
client_id: &'a str | identifies the Client to the Server. |
username: Option<&'a str> | username can be used by the Server for authentication and authorization. |
password: Option<&'a [u8]> | password can be used by the Server for authentication and authorization. |
ConnectAck
Connect acknowledgment
Fields of ConnectAck
session_present: bool | enables a Client to establish whether the Client and Server have a consistent view about whether there is already stored Session state. |
return_code: ConnectReturnCode |
Publish
Publish message
Fields of Publish
dup: bool | this might be re-delivery of an earlier attempt to send the Packet. |
retain: bool | |
qos: QoS | the level of assurance for delivery of an Application Message. |
topic: &'a str | the information channel to which payload data is published. |
packet_id: Option<u16> | only present in PUBLISH Packets where the QoS level is 1 or 2. |
payload: &'a [u8] | the Application Message that is being published. |
PublishAck
Publish acknowledgment
Fields of PublishAck
packet_id: u16 | Packet Identifier |
PublishReceived
Publish received (assured delivery part 1)
Fields of PublishReceived
packet_id: u16 | Packet Identifier |
PublishRelease
Publish release (assured delivery part 2)
Fields of PublishRelease
packet_id: u16 | Packet Identifier |
PublishComplete
Publish complete (assured delivery part 3)
Fields of PublishComplete
packet_id: u16 | Packet Identifier |
Subscribe
Client subscribe request
Fields of Subscribe
packet_id: u16 | Packet Identifier |
topic_filters: Vec<(&'a str, QoS)> | the list of Topic Filters and QoS to which the Client wants to subscribe. |
SubscribeAck
Subscribe acknowledgment
Fields of SubscribeAck
packet_id: u16 | |
status: Vec<SubscribeReturnCode> | corresponds to a Topic Filter in the SUBSCRIBE Packet being acknowledged. |
Unsubscribe
Unsubscribe request
Fields of Unsubscribe
packet_id: u16 | Packet Identifier |
topic_filters: Vec<&'a str> | the list of Topic Filters that the Client wishes to unsubscribe from. |
UnsubscribeAck
Unsubscribe acknowledgment
Fields of UnsubscribeAck
packet_id: u16 | Packet Identifier |
PingRequest
PING request
PingResponse
PING response
Disconnect
Client is disconnecting
Methods
impl<'a> Packet<'a>
[src]
fn packet_type(&self) -> u8
[src]
MQTT Control Packet type
fn packet_flags(&self) -> u8
[src]
Flags specific to each MQTT Control Packet type
Trait Implementations
impl<'a> Debug for Packet<'a>
[src]
impl<'a> PartialEq for Packet<'a>
[src]
fn eq(&self, __arg_0: &Packet<'a>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Packet<'a>) -> bool
[src]
This method tests for !=
.