pub fn write_frame<W: Write>(
writer: &mut W,
body: &[u8],
) -> Result<usize, FramingError>Expand description
Write one v1 frame to writer.
The frame is laid out as [u8 framing_version=1][u32 LE body_length][body]. Returns the number of bytes written on
success (5 + body.len()).
ยงErrors
FramingError::FrameTooLargeifbody.len()exceedsMAX_FRAME_BYTES. The caller must not exceedMAX_HELLO_BYTESfor Hello frames; this guard catches only the absolute ceiling.FramingError::Iofor any other I/O error.