Closed
Description
so that clients can assume that read
returns a positive number of bytes read or an error. Here, error includes EOF (EndOfFile
) and EAGAIN/EWOULDBLOCK (ResourceUnavailable
).
The current docs already state that Reader
implementation should never return Ok(0)
if they can avoid it. This should be changed to a clear statement that Reader
s are never allowed to return Ok(0)
.
It's probably not possible to enforce this at compile- or runtime right now. If Rust gets types that can contain certain ranges of integers, the return type of read
can be changed to IoResult<[1..UINT_MAX]>
.
Metadata
Metadata
Assignees
Labels
No labels