bitcoin_io

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.

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.

Object Safety§

This trait is not object safe.

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>

Available on crate feature std only.
source§

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

source§

fn consume(&mut self, amount: usize)

source§

impl BufRead for StdinLock<'_>

Available on crate feature std only.
source§

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

source§

fn consume(&mut self, amount: usize)

source§

impl BufRead for Empty

Available on crate feature std only.
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>

Available on crate feature std only.
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,

Available on crate feature std only.
source§

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

source§

fn consume(&mut self, amount: usize)

source§

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

Available on crate feature std only.
source§

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

source§

fn consume(&mut self, amount: usize)

source§

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

Available on crate feature std only.
source§

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

source§

fn consume(&mut self, amount: usize)

source§

impl<T: BufRead> BufRead for &mut T

source§

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

source§

fn consume(&mut self, amount: usize)

Implementors§

source§

impl<'a, R: BufRead + ?Sized> BufRead for bitcoin_io::Take<'a, R>

source§

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

source§

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

Available on crate feature std only.
source§

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

Available on crate feature std only.