pub enum Packet {
Show 14 variants
Connect(Box<Connect>),
ConnectAck {
session_present: bool,
return_code: ConnectAckReason,
},
Publish(Publish),
PublishAck {
packet_id: NonZeroU16,
},
PublishReceived {
packet_id: NonZeroU16,
},
PublishRelease {
packet_id: NonZeroU16,
},
PublishComplete {
packet_id: NonZeroU16,
},
Subscribe {
packet_id: NonZeroU16,
topic_filters: Vec<(ByteString, QoS)>,
},
SubscribeAck {
packet_id: NonZeroU16,
status: Vec<SubscribeReturnCode>,
},
Unsubscribe {
packet_id: NonZeroU16,
topic_filters: Vec<ByteString>,
},
UnsubscribeAck {
packet_id: NonZeroU16,
},
PingRequest,
PingResponse,
Disconnect,
}
Expand description
MQTT Control Packets
Variants
Connect(Box<Connect>)
Client request to connect to Server
ConnectAck
Fields
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: ConnectAckReason
Connect acknowledgment
Publish(Publish)
Publish message
PublishAck
Fields
packet_id: NonZeroU16
Packet Identifier
Publish acknowledgment
PublishReceived
Fields
packet_id: NonZeroU16
Packet Identifier
Publish received (assured delivery part 1)
PublishRelease
Fields
packet_id: NonZeroU16
Packet Identifier
Publish release (assured delivery part 2)
PublishComplete
Fields
packet_id: NonZeroU16
Packet Identifier
Publish complete (assured delivery part 3)
Subscribe
Fields
packet_id: NonZeroU16
Packet Identifier
topic_filters: Vec<(ByteString, QoS)>
the list of Topic Filters and QoS to which the Client wants to subscribe.
Client subscribe request
SubscribeAck
Fields
packet_id: NonZeroU16
status: Vec<SubscribeReturnCode>
corresponds to a Topic Filter in the SUBSCRIBE Packet being acknowledged.
Subscribe acknowledgment
Unsubscribe
Fields
packet_id: NonZeroU16
Packet Identifier
topic_filters: Vec<ByteString>
the list of Topic Filters that the Client wishes to unsubscribe from.
Unsubscribe request
UnsubscribeAck
Fields
packet_id: NonZeroU16
Packet Identifier
Unsubscribe acknowledgment
PingRequest
PING request
PingResponse
PING response
Disconnect
Client is disconnecting
Implementations
sourceimpl Packet
impl Packet
pub fn packet_type(&self) -> u8
Trait Implementations
impl StructuralPartialEq for Packet
Auto Trait Implementations
impl !RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl !UnwindSafe for Packet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more