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<R> BufRead for BufReader<R>
where R: Read,

§

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

§

fn consume(&mut self, amount: usize)

Implementors§

§

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

§

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