Enum ClientEvent
#[non_exhaustive]pub enum ClientEvent<'a> {
Connected {
session_present: bool,
capabilities: ServerCapabilities,
},
#[non_exhaustive] MessageReceived {
publish: ReceivedPublish<'a>,
topic: &'a Topic,
},
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 (topic alias, QoS 2
duplicate filter, receive quota).
Fields
This variant is marked as non-exhaustive
publish: ReceivedPublish<'a>The decoded PUBLISH, borrowing from the handled packet.
Its destination can be an alias without a topic. Read the topic
from topic.
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 filter, at the positions that
pending_filters reports
once TransmitEvent::SubscribeSent is reported.
UnsubscribeAcked
UNSUBACK received.
Fields
reason_codes: &'a [ReasonCode]One reason code per filter, at the positions that
pending_filters reports
once TransmitEvent::UnsubscribeSent is reported.
Disconnected
Server sent DISCONNECT.
Fields
reason_code: ReasonCodeReason code from the DISCONNECT packet.
PingResponse
PINGRESP received.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ClientEvent<'a>
impl<'a> RefUnwindSafe for ClientEvent<'a>
impl<'a> Send for ClientEvent<'a>
impl<'a> Sync for ClientEvent<'a>
impl<'a> Unpin for ClientEvent<'a>
impl<'a> UnsafeUnpin for ClientEvent<'a>
impl<'a> UnwindSafe for ClientEvent<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more