Skip to main content

read_frame_bytes_within

Function read_frame_bytes_within 

Source
pub async fn read_frame_bytes_within<R>(
    reader: &mut R,
    max: u32,
) -> Result<Vec<u8>, CodecError>
where R: AsyncRead + Unpin,
Expand description

As read_frame_bytes, refusing a frame longer than max (at most MAX_FRAME) before anything is allocated for it.