Skip to main content

encode_line

Function encode_line 

Source
pub fn encode_line<T: Serialize>(value: &T) -> Result<Vec<u8>, Error>
Expand description

Encode a value as JSON and append \n. Centralises framing so server.rs / client.rs share one implementation.

ยงErrors

Returns the underlying serde_json::Error if value fails to serialize.