pub trait ReadMany {
// Required method
fn read_many(&mut self, buf: &mut [u8]) -> Result<usize>;
}
Expand description
Retry read
if it read short, to check we’re at the end of the file.
read
is allowed to return fewer bytes than requested, even if
we’re not at the end of the file.
read_exact
has undefined behaviour if we hit the end of the file
while reading. It will return an error, but won’t necessarily have
put the lost bytes into the buffer.
read_many
will only return a short read if the underlying reader
returns 0
, indicating an end of file condition.