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

Client request to connect to Server

Fields of Connect

the handling of the Session state.

a time interval measured in seconds.

Will Message be stored on the Server and associated with the Network Connection.

identifies the Client to the Server.

username can be used by the Server for authentication and authorization.

password can be used by the Server for authentication and authorization.

Connect acknowledgment

Fields of ConnectAck

enables a Client to establish whether the Client and Server have a consistent view about whether there is already stored Session state.

Publish message

Fields of Publish

this might be re-delivery of an earlier attempt to send the Packet.

the level of assurance for delivery of an Application Message.

the information channel to which payload data is published.

only present in PUBLISH Packets where the QoS level is 1 or 2.

the Application Message that is being published.

Publish acknowledgment

Fields of PublishAck

Packet Identifier

Publish received (assured delivery part 1)

Fields of PublishReceived

Packet Identifier

Publish release (assured delivery part 2)

Fields of PublishRelease

Packet Identifier

Publish complete (assured delivery part 3)

Fields of PublishComplete

Packet Identifier

Client subscribe request

Fields of Subscribe

Packet Identifier

the list of Topic Filters and QoS to which the Client wants to subscribe.

Subscribe acknowledgment

Fields of SubscribeAck

corresponds to a Topic Filter in the SUBSCRIBE Packet being acknowledged.

Unsubscribe request

Fields of Unsubscribe

Packet Identifier

the list of Topic Filters that the Client wishes to unsubscribe from.

Unsubscribe acknowledgment

Fields of UnsubscribeAck

Packet Identifier

PING request

PING response

Client is disconnecting

Methods

impl<'a> Packet<'a>
[src]

[src]

MQTT Control Packet type

[src]

Flags specific to each MQTT Control Packet type

Trait Implementations

impl<'a> Debug for Packet<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> PartialEq for Packet<'a>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<'a> Clone for Packet<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more