Skip to main content

write_frame

Function write_frame 

Source
pub async fn write_frame<W: AsyncWrite + Unpin>(
    writer: &mut W,
    body: &[u8],
) -> Result<(), ProtocolError>
Expand description

Write body as one length-prefixed frame and flush. Rejects a body larger than MAX_FRAME_BYTES before writing so a buggy handler cannot emit an un-readable frame.