pub fn from_u16(i: u16) -> PacketType {
        match i {
            0x01 => PacketType::ClientHandshake,
            0x02 => PacketType::ServerHandshake,
            0x03 => PacketType::ClientAuthentication,
            0x10 => PacketType::Disconnect,
            0x11 => PacketType::Reset,
            0x20 => PacketType::EncryptedData,
            _ => PacketType::Unknown,
        }
    }
/// Convert u16 integer to a PacketType enum
Convert u16 integer to a PacketType enum
Convert u16 integer to a PacketType enum
pub fn from_u16(i: u16) -> PacketType {
        match i {
            0x01 => PacketType::ClientHandshake,
            0x02 => PacketType::ServerHandshake,
            0x03 => PacketType::ClientAuthentication,
            0x10 => PacketType::Disconnect,
            0x11 => PacketType::Reset,
            0x20 => PacketType::EncryptedData,
            _ => PacketType::Unknown,
        }
    }
pub fn from_u16 ( i : u16 ) -> PacketType { match i { 0x01 => PacketType :: ClientHandshake , 0x02 => PacketType :: ServerHandshake , 0x03 => PacketType :: ClientAuthentication , 0x10 => PacketType :: Disconnect , 0x11 => PacketType :: Reset , 0x20 => PacketType :: EncryptedData , _ => PacketType :: Unknown , } }
Convert u16 integer to a PacketType enum
Convert u16 integer to a PacketType enum
i
u16
i
u16