pub trait BufRead: Read {
// Required methods
fn fill_buf(&mut self) -> Result<&[u8]>;
fn consume(&mut self, amt: usize);
// Provided methods
fn has_data_left(&mut self) -> Result<bool> { ... }
fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize> { ... }
fn read_line(&mut self, buf: &mut String) -> Result<usize> { ... }
}Expand description
A BufRead is a type of Reader which has an internal buffer, allowing it
to perform extra ways of reading.
Required Methods§
Provided Methods§
sourcefn has_data_left(&mut self) -> Result<bool>
fn has_data_left(&mut self) -> Result<bool>
Check if the underlying Read has any data left to be read.