#[repr(u8)]pub enum PacketType {
Show 15 variants
Connect = 1,
Connack = 2,
Publish = 3,
Puback = 4,
Pubrec = 5,
Pubrel = 6,
Pubcomp = 7,
Subscribe = 8,
Suback = 9,
Unsubscribe = 10,
Unsuback = 11,
Pingreq = 12,
Pingresp = 13,
Disconnect = 14,
Auth = 15,
}Variants§
Connect = 1
Connection request Client to Server
Connack = 2
Connect acknowledgment Server to Client
Publish = 3
Publish message Client to Server or Server to Client
Puback = 4
Publish acknowledgment (quality of service 1) Client to Server or Server to Client
Pubrec = 5
Publish received (quality of service 2 delivery part 1) Client to Server or Server to Client
Pubrel = 6
Publish release (quality of service 2 delivery part 2) Client to Server or Server to Client
Pubcomp = 7
Publish complete (quality of service 2 delivery part 3) Client to Server or Server to Client
Subscribe = 8
Subscribe request Client to Server
Suback = 9
Subscribe acknowledgment Server to Client
Unsubscribe = 10
Unsubscribe request Client to Server
Unsuback = 11
Unsubscribe acknowledgment Server to Client
Pingreq = 12
PING request Client to Server
Pingresp = 13
PING response Server to Client
Disconnect = 14
Disconnect notification Client to Server or Server to Client
Auth = 15
Authentication exchange Client to Server or Server to Client
Implementations§
Source§impl PacketType
impl PacketType
Sourcepub fn is_valid_first_header_byte(encoded: u8) -> bool
pub fn is_valid_first_header_byte(encoded: u8) -> bool
Check whether a u8 value is a valid first header byte of a packet
Trait Implementations§
Source§impl Debug for PacketType
impl Debug for PacketType
Source§impl From<PacketType> for u8
Note this only provides the “base” representation, with no
additional flags set for PacketType::Publish, but does
include the fixed additional bits that some packets require.
impl From<PacketType> for u8
Note this only provides the “base” representation, with no additional flags set for PacketType::Publish, but does include the fixed additional bits that some packets require.
Source§fn from(value: PacketType) -> Self
fn from(value: PacketType) -> Self
Source§impl PartialEq for PacketType
impl PartialEq for PacketType
Source§fn eq(&self, other: &PacketType) -> bool
fn eq(&self, other: &PacketType) -> bool
self and other values to be equal, and is used by ==.Source§impl TryFrom<u8> for PacketType
Parse the PacketType from a u8, using only the upper 4 bits
and ignoring any additional flags set for PacketType::Publish
impl TryFrom<u8> for PacketType
Parse the PacketType from a u8, using only the upper 4 bits and ignoring any additional flags set for PacketType::Publish