is_eof

Function is_eof 

Source
pub fn is_eof(reader: &mut dyn Read) -> bool
Expand description

Checks if the reader has reached EOF (end of file).

It attempts to read a single byte from the reader into a buffer. If Ok(0) is returned, it means no byte was read, indicating that the end of the stream has been reached and there is no more data left to read.

Any other return value means that data was successfully read, so the reader has not reached the end yet.

§Arguments

  • reader - The reader to check for EOF state It must implement the std::io::Read trait

§Returns

true if the reader reached EOF, false otherwise