Enum ClientEvent
#[non_exhaustive]pub enum ClientEvent<'a> {
Connected {
session_present: bool,
capabilities: ServerCapabilities,
},
#[non_exhaustive] MessageReceived {
publish: Publish<'a>,
},
PublishAcked {
packet_id: PacketId,
reason_code: ReasonCode,
},
PublishComplete {
packet_id: PacketId,
reason_code: ReasonCode,
},
SubscribeAcked {
packet_id: PacketId,
reason_codes: &'a [ReasonCode],
},
UnsubscribeAcked {
packet_id: PacketId,
reason_codes: &'a [ReasonCode],
},
Disconnected {
reason_code: ReasonCode,
},
PingResponse,
}Expand description
Events produced by the client state machine for the application layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connected
Connection established successfully.
Fields
session_present: boolWhether the server had existing session state. When false, the
I/O driver must call Client::session_lost before draining the
session onto the new connection.
capabilities: ServerCapabilitiesServer-advertised capabilities from CONNACK properties.
#[non_exhaustive]MessageReceived
An application message to deliver.
The PUBLISH already passed the protocol checks (QoS 2 duplicate
filter, receive quota).
Fields
This variant is marked as non-exhaustive
PublishAcked
A QoS 1 publish was acknowledged (PUBACK received).
Fields
reason_code: ReasonCodeReason code from the PUBACK.
PublishComplete
A QoS 2 publish flow completed (PUBCOMP received, or PUBREC with
error reason code).
Fields
reason_code: ReasonCodeReason code from the final acknowledgement.
SubscribeAcked
SUBACK received.
Fields
reason_codes: &'a [ReasonCode]One reason code per requested subscription.
UnsubscribeAcked
UNSUBACK received.
Fields
reason_codes: &'a [ReasonCode]One reason code per requested unsubscription.
Disconnected
Server sent DISCONNECT.
Fields
reason_code: ReasonCodeReason code from the DISCONNECT packet.
PingResponse
PINGRESP received.