pub trait BytesReaderExt: Reader {
// Required method
fn take_bytes(&mut self, n: usize) -> Result<Bytes, DecodeError>;
}Expand description
Extension methods for a Reader that is backed by Bytes.
Required Methods§
Sourcefn take_bytes(&mut self, n: usize) -> Result<Bytes, DecodeError>
fn take_bytes(&mut self, n: usize) -> Result<Bytes, DecodeError>
Take the next n bytes as a zero-copy Bytes slice and advance the reader.