pub fn decode_message(buf: &[u8]) -> Result<(MessageType, usize), ProtocolError>
Expand description
Reads a header-prefixed message from a byte slice, and returns the number of bytes consumed. Returns ProtocolError::ShortBuffer if the buffer contains a partial message.