[][src]Enum mqtt_codec::Packet

pub enum Packet {
    Connect(Connect),
    ConnectAck {
        session_present: bool,
        return_code: ConnectCode,
    },
    Publish(Publish),
    PublishAck {
        packet_id: u16,
    },
    PublishReceived {
        packet_id: u16,
    },
    PublishRelease {
        packet_id: u16,
    },
    PublishComplete {
        packet_id: u16,
    },
    Subscribe {
        packet_id: u16,
        topic_filters: Vec<(ByteString, QoS)>,
    },
    SubscribeAck {
        packet_id: u16,
        status: Vec<SubscribeReturnCode>,
    },
    Unsubscribe {
        packet_id: u16,
        topic_filters: Vec<ByteString>,
    },
    UnsubscribeAck {
        packet_id: u16,
    },
    PingRequest,
    PingResponse,
    Disconnect,
}

MQTT Control Packets

Variants

Connect(Connect)

Client request to connect to Server

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: ConnectCode
Publish(Publish)

Publish message

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<(ByteString, QoS)>

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

SubscribeAck

Subscribe acknowledgment

Fields of SubscribeAck

packet_id: u16status: 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<ByteString>

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 Packet[src]

pub fn packet_type(&self) -> u8[src]

MQTT Control Packet type

pub fn packet_flags(&self) -> u8[src]

Flags specific to each MQTT Control Packet type

Trait Implementations

impl From<Connect> for Packet[src]

impl From<Publish> for Packet[src]

impl Clone for Packet[src]

impl PartialEq<Packet> for Packet[src]

impl Debug for Packet[src]

impl StructuralPartialEq for Packet[src]

Auto Trait Implementations

impl Send for Packet

impl Sync for Packet

impl Unpin for Packet

impl UnwindSafe for Packet

impl RefUnwindSafe for Packet

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]