Trait method lrs::prelude::v1::Read::read

Reads from the byte-stream into a buffer.

Syntax

fn read(&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

If the length of the buffer is 0, the meaning of a 0 return value is unspecified. Otherwise a return value of 0 signals End-Of-File.

The default implementation calls scatter_read with a single buffer element.

See also