Skip to main content

write_frame_with_deadline

Function write_frame_with_deadline 

Source
pub async fn write_frame_with_deadline<W, T>(
    writer: &mut W,
    msg: &T,
    deadline: Option<Duration>,
) -> Result<(), WireError>
where W: AsyncWriteExt + Unpin, T: Serialize,
Expand description

Write one length-prefixed JSON frame, with an optional total-operation deadline.

Deadline covers write_all(len) + write_all(body) + flush as one unit; a partial write that times out leaves the writer in an unspecified state (caller should close the connection).