Skip to main content

BytesReaderExt

Trait BytesReaderExt 

Source
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§

Source

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.

Implementors§