You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 Readers 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]>.