pub fn decode(data: &[u8]) -> Result<Frame, ProtocolError>
Decode a frame from bytes.
Returns an error if the data is incomplete, too large, or invalid.