pub fn read_frame<R: Read>(reader: &mut R) -> Result<Vec<u8>, FramingError>Expand description
Read one v1 frame from reader with the default 16 MiB cap.
Equivalent to read_frame_with_cap(reader, MAX_FRAME_BYTES). Use
read_frame_with_cap with MAX_HELLO_BYTES for the initial
Hello envelope.
ยงErrors
FramingError::UnsupportedFramingVersionif the leading byte is notENVELOPE_VERSION. The connection should be closed after writingRefused{ERROR_VERSION_UNSUPPORTED}.FramingError::FrameTooLargeif the body-length header exceeds the cap. The connection should be closed.FramingError::UnexpectedEofif the stream returned EOF before all expected bytes arrived.FramingError::Iofor any other I/O error.