Skip to main content

read_frame

Function read_frame 

Source
pub async fn read_frame<R>(r: &mut R) -> Result<Option<Vec<u8>>>
where R: AsyncRead + Unpin,
Expand description

Read a single framed blob.

Returns Ok(None) when the peer closes cleanly at a frame boundary (zero bytes read before any length-prefix byte). Returns io::ErrorKind::UnexpectedEof when the stream ends mid-prefix or mid-body.