pub fn read_header(
    buf: &[u8],
    offset: &mut usize
) -> Result<Option<(Header, usize)>, Error>
Expand description

Read the parsed header and remaining_len from the buffer. Only return Some() and advance the buffer position if there is enough data in the buffer to read the full packet.