BufRead

Trait BufRead 

Source
pub trait BufRead: Read {
    // Required methods
    fn fill_buf(&mut self) -> Result<&[u8]>;
    fn consume(&mut self, amount: usize);
}
Expand description

A trait describing an input stream that uses an internal buffer when reading.

Required Methods§

Source

fn fill_buf(&mut self) -> Result<&[u8]>

Returns data read from this reader, filling the internal buffer if needed.

§Errors

May error if reading fails.

Source

fn consume(&mut self, amount: usize)

Marks the buffered data up to amount as consumed.

§Panics

May panic if amount is greater than amount of data read by fill_buf.

Implementations on Foreign Types§

Source§

impl BufRead for &[u8]

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Source§

impl BufRead for VecDeque<u8>

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Source§

impl BufRead for StdinLock<'_>

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Source§

impl BufRead for Empty

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Source§

impl<R1: BufRead, R2: BufRead> BufRead for Chain<R1, R2>

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Source§

impl<R> BufRead for BufReader<R>
where R: ?Sized + Read,

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Source§

impl<R: BufRead> BufRead for Take<R>

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Source§

impl<T: AsRef<[u8]>> BufRead for Cursor<T>

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Source§

impl<T: BufRead + ?Sized> BufRead for &mut T

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amount: usize)

Implementors§

Source§

impl<R: BufRead> BufRead for bitcoin_io::Take<R>

Source§

impl<T: AsRef<[u8]>> BufRead for bitcoin_io::Cursor<T>

Source§

impl<T: BufRead> BufRead for FromStd<T>

Source§

impl<T: BufRead> BufRead for ToStd<T>