Skip to main content

read_frame

Function read_frame 

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

Reads one frame written by write_frame. The buffer grows as bytes arrive, so a declared length costs nothing until the peer sends it.

§Errors

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