Feature gate: #![feature(buf_read_has_data_left)]
This is a tracking issue for adding has_data_left to BufRead. Its purpose is to determine whether a reader has any data left over to read.
Example
let file = File::open("foo.txt")?;
let reader = BufReader::new(file);
let is_not_empty = reader.has_data_left()?;
Steps / History
Unresolved Questions
- Still need to finalize the name of
has_data_left and whether the API should check the positive case or the negative case.
- Internals discussion (note that the post uses
is_at_eof as the name of the new method).
Feature gate:
#![feature(buf_read_has_data_left)]This is a tracking issue for adding
has_data_lefttoBufRead. Its purpose is to determine whether a reader has any data left over to read.Example
Steps / History
Unresolved Questions
has_data_leftand whether the API should check the positive case or the negative case.is_at_eofas the name of the new method).