Function mqtt::read_packet
[−]
[src]
pub fn read_packet(i: &[u8]) -> Result<(&[u8], Packet), IError>
Read packet from the underlying &[u8]
.
use mqtt::{read_packet, Packet}; assert_eq!(read_packet(b"\xc0\x00\xd0\x00").unwrap(), (&b"\xd0\x00"[..], Packet::PingRequest));