Trait bdk_chain::bitcoin::io::BufRead

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

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

Required Methods§

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

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

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§

§

impl BufRead for &[u8]

§

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

§

fn consume(&mut self, amount: usize)

§

impl BufRead for VecDeque<u8>

§

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

§

fn consume(&mut self, amount: usize)

§

impl BufRead for StdinLock<'_>

§

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

§

fn consume(&mut self, amount: usize)

§

impl BufRead for Empty

§

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

§

fn consume(&mut self, amount: usize)

§

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

§

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

§

fn consume(&mut self, amount: usize)

§

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

§

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

§

fn consume(&mut self, amount: usize)

§

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

§

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

§

fn consume(&mut self, amount: usize)

§

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

§

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

§

fn consume(&mut self, amount: usize)

Implementors§

§

impl<'a, R> BufRead for bdk_chain::bitcoin::io::Take<'a, R>
where R: BufRead + ?Sized,

§

impl<T> BufRead for bdk_chain::bitcoin::io::Cursor<T>
where T: AsRef<[u8]>,

§

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

§

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