Trait method lrs::io::Read::read_all

Tries to read bytes until the buffer is buffer.

Syntax

fn read_all(&mut self, buf: &mut [u8]) -> Result<usize, Errno>

Arguments

NameDescription
buf

The buffer that will be filled.

Return value

Returns the total number of bytes read.

Remarks

The default implementation calls read multiple times until the buffer is full or 0 is returned. If an error occurs the error is returned immediately and all bytes read up to that point are lost. This convenience method should thus not be used in reliable programs.

See also