Enum sage_mqtt::Packet[][src]

pub enum Packet {
Show 15 variants Connect(Connect), ConnAck(ConnAck), Publish(Publish), PubAck(PubAck), PubRec(PubRec), PubRel(PubRel), PubComp(PubComp), Subscribe(Subscribe), SubAck(SubAck), UnSubscribe(UnSubscribe), UnSubAck(UnSubAck), PingReq, PingResp, Disconnect(Disconnect), Auth(Auth),
}
Expand description

The standard type to manipulate a AsyncRead/AsyncWrite-able MQTT packet. Each packet is an enum value with its own type.

Variants

Connect(Connect)

Tuple Fields

CONNECT MQTT packet. Opens a connection request.

ConnAck(ConnAck)

Tuple Fields

CONNACK MQTT packet. Aknowledge a connectio request.

Publish(Publish)

Tuple Fields

PUBLISH MQTT packet. Delivery a message to or from a server.

PubAck(PubAck)

Tuple Fields

0: PubAck

PUBACK MQTT packet. Ackowledge a QoS 1 or QoS 2 message.

PubRec(PubRec)

Tuple Fields

0: PubRec

PUBREC MQTT packet. Ackowledge a QoS 2 message.

PubRel(PubRel)

Tuple Fields

0: PubRel

PUBREL MQTT packet. Ackowledge a QoS 2 message.

PubComp(PubComp)

Tuple Fields

PUBCOMP MQTT packet. Ackowledge a QoS 2 message.

Subscribe(Subscribe)

Tuple Fields

SUBSCRIBE MQTT packet. Subscribe a client to topics.

SubAck(SubAck)

Tuple Fields

0: SubAck

SUBACK MQTT packet. Acknowledge a client SUBSCRIBE packet.

UnSubscribe(UnSubscribe)

Tuple Fields

UNSUBSCRIBE MQTT packet. Unsubscribe a client from topics.

UnSubAck(UnSubAck)

Tuple Fields

UNSUBACK MQTT packet. Acknowledge a client UNSUBSCRIBE packet.

PingReq

PINGREQ MQTT packet. Send a ping request.

PingResp

PINGRESP MQTT packet. Respond to a ping request.

Disconnect(Disconnect)

Tuple Fields

DISCONNECT MQTT packet. Disconnect a connextion and optionally a session.

Auth(Auth)

Tuple Fields

0: Auth

AUTH MQTT packet. Performs authentication exchanges between clients and server.

Implementations

Write the entire Packet to writer, returning the number of bytes written. In case of failure, the operation will return any MQTT-related error, or std::io::Error.

Read a control packet from reader, returning a new Packet. In case of failure, the operation will return any MQTT-related error, or std::io::Error.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.