pub enum Packet {
Show 15 variants
Connect(Box<ConnectPacket>),
ConnAck(ConnAckPacket),
Publish(PublishPacket),
PubAck(PubAckPacket),
PubRec(PubRecPacket),
PubRel(PubRelPacket),
PubComp(PubCompPacket),
Subscribe(SubscribePacket),
SubAck(SubAckPacket),
Unsubscribe(UnsubscribePacket),
UnsubAck(UnsubAckPacket),
PingReq,
PingResp,
Disconnect(DisconnectPacket),
Auth(AuthPacket),
}Expand description
Enum representing all MQTT packet types
Variants§
Connect(Box<ConnectPacket>)
ConnAck(ConnAckPacket)
Publish(PublishPacket)
PubAck(PubAckPacket)
PubRec(PubRecPacket)
PubRel(PubRelPacket)
PubComp(PubCompPacket)
Subscribe(SubscribePacket)
SubAck(SubAckPacket)
Unsubscribe(UnsubscribePacket)
UnsubAck(UnsubAckPacket)
PingReq
PingResp
Disconnect(DisconnectPacket)
Auth(AuthPacket)
Implementations§
Source§impl Packet
impl Packet
Sourcepub fn decode_from_body<B: Buf>(
packet_type: PacketType,
fixed_header: &FixedHeader,
buf: &mut B,
) -> Result<Self>
pub fn decode_from_body<B: Buf>( packet_type: PacketType, fixed_header: &FixedHeader, buf: &mut B, ) -> Result<Self>
Sourcepub fn decode_from_body_with_version<B: Buf>(
packet_type: PacketType,
fixed_header: &FixedHeader,
buf: &mut B,
protocol_version: u8,
) -> Result<Self>
pub fn decode_from_body_with_version<B: Buf>( packet_type: PacketType, fixed_header: &FixedHeader, buf: &mut B, protocol_version: u8, ) -> Result<Self>
Decode a packet body based on the packet type with protocol version
§Errors
Returns an error if decoding fails
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Packet
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
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
Mutably borrows from an owned value. Read more