Skip to main content

read_frame

Function read_frame 

Source
pub async fn read_frame<R: AsyncRead + Unpin + ?Sized>(
    io: &mut R,
) -> Result<Vec<u8>>
Expand description

read_frame over a tokio stream: the buffer grows as bytes arrive.

§Errors

InvalidData when the declared length is above MAX_MESSAGE, UnexpectedEof when the stream ends inside the frame; otherwise the stream’s error.