pub fn encode(message: &ProtocolMessage) -> Res<Vec<u8>>
Encodes a frame to its wire bytes with the fixed codec configuration.
Returns an error if the frame cannot be serialized.