Trait pot::reader::Reader

source ·
pub trait Reader<'de>: ReadBytesExt {
    // Required method
    fn buffered_read_bytes(
        &mut self,
        length: usize,
        scratch: &mut Vec<u8>,
    ) -> Result<BufferedBytes<'de>, Error>;
}
Expand description

A reader that can temporarily buffer bytes read.

Required Methods§

source

fn buffered_read_bytes( &mut self, length: usize, scratch: &mut Vec<u8>, ) -> Result<BufferedBytes<'de>, Error>

Reads exactly length bytes.

If the reader supports borrowing bytes, BufferedBytes::Data should be returned. Otherwise, the bytes will be read into scratch. scratch should only be assumed to be valid if BufferedBytes::Scratch is returned.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'de> Reader<'de> for SliceReader<'de>

source§

impl<'de, R: ReadBytesExt> Reader<'de> for IoReader<R>