[][src]Function mqtt4bytes::packet_type

pub fn packet_type(num: u8) -> Result<PacketType, Error>

Packet type from a byte

This example is not tested
         7                          3                          0
         +--------------------------+--------------------------+
byte 1   | MQTT Control Packet Type | Flags for each type      |
         +--------------------------+--------------------------+
         |         Remaining Bytes Len  (1 - 4 bytes)          |
         +-----------------------------------------------------+

http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Figure_2.2_-