Skip to main content

write_message

Function write_message 

Source
pub fn write_message<W: Write, T: Serialize>(
    writer: &mut W,
    message: &T,
) -> Result<()>
Expand description

Write one JSON-RPC message as a single newline-terminated line, then flush. Callers pass the single locked stdout handle owned by super::serve; nothing else in the crate may write to stdout during a serve, so this helper is the stdout-purity enforcement point (C-005).