pub trait ReadMany {
    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.

Required Methods

Try quite hard to fill buf with bytes.

Give up if the underlying reader returns an end-of-file condition or error only, not if it’s just a bit lazy.

Errors from the underlying reader will be returned as-is.

Implementors