Decode a packet with binary data from a u8 slice.
Each packet has a packet type (Open, Close, Message…) and a data section.
decode_packet assumes the packet’s data is meant to be binary.
Decode a binary-encoded payload containing multiple packets.
Returns a Vec of parsed Packets, with the appropriate PacketData type
for each packet if successful.
In an encoded payload, each packet is denoted with its length and its
data type; either binary or string. This function returns binary packet
data as is, and parses string packets to UTF-8.