pub fn encode<T: Serialize>(message: &T) -> Result<Vec<u8>, Error>
Serializes a message as one line, including the trailing newline.