Skip to main content

read_frame

Function read_frame 

Source
pub async fn read_frame<R>(
    reader: &mut R,
) -> Result<Option<Frame>, FrameIoError>
where R: AsyncRead + Unpin,
Expand description

Read one complete frame from an async stream.

Returns Ok(None) only for a clean EOF before the next header begins. EOF after any header byte, or before all body bytes arrive, is a typed FrameIoError::UnexpectedEof. The body is returned as opaque bytes.