Skip to main content

write_message

Function write_message 

Source
pub async fn write_message<W, T>(
    w: &mut W,
    message: &T,
) -> Result<(), DaemonError>
where W: AsyncWrite + Unpin, T: Serialize,
Expand description

Write one length-prefixed JSON message to w.

§Errors

Returns DaemonError::Io on a transport failure or DaemonError::Protocol if the message serializes to a body larger than MAX_MESSAGE_BYTES.