pub enum Packet {
}
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)
CONNECT MQTT packet. Opens a connection request.
ConnAck(ConnAck)
CONNACK MQTT packet. Aknowledge a connectio request.
Publish(Publish)
PUBLISH MQTT packet. Delivery a message to or from a server.
PubAck(PubAck)
PUBACK MQTT packet. Ackowledge a QoS 1 or QoS 2 message.
PubRec(PubRec)
PUBREC MQTT packet. Ackowledge a QoS 2 message.
PubRel(PubRel)
PUBREL MQTT packet. Ackowledge a QoS 2 message.
PubComp(PubComp)
PUBCOMP MQTT packet. Ackowledge a QoS 2 message.
Subscribe(Subscribe)
SUBSCRIBE MQTT packet. Subscribe a client to topics.
SubAck(SubAck)
SUBACK MQTT packet. Acknowledge a client SUBSCRIBE packet.
UnSubscribe(UnSubscribe)
UNSUBSCRIBE MQTT packet. Unsubscribe a client from topics.
UnSubAck(UnSubAck)
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)
DISCONNECT MQTT packet. Disconnect a connextion and optionally a session.
Auth(Auth)
AUTH MQTT packet. Performs authentication exchanges between clients and server.
Implementations§
Source§impl Packet
impl Packet
Sourcepub async fn encode<W: AsyncWrite + Unpin>(
self,
writer: &mut W,
) -> SageResult<usize>
pub async fn encode<W: AsyncWrite + Unpin>( self, writer: &mut W, ) -> SageResult<usize>
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
.