Skip to main content

serialize_message

Function serialize_message 

Source
pub fn serialize_message(msg: &IpcMessage) -> Result<String>
Expand description

Serialize an IpcMessage to a single NDJSON line (trailing \n).

Why: Callers write one message per line to the IPC pipe; centralizing the newline here prevents framing bugs at call sites. What: Returns "{...json...}\n". Test: Assert output ends with \n and contains no embedded newlines in the JSON prefix.