We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 46d97c2 + 05fc7fa commit 4b337d2Copy full SHA for 4b337d2
src/libstd/io/mod.rs
@@ -517,6 +517,11 @@ pub trait Read {
517
/// reader will *always* no longer be able to produce bytes.
518
/// 2. The buffer specified was 0 bytes in length.
519
///
520
+ /// It is not an error if the returned value `n` is smaller than the buffer size,
521
+ /// even when the reader is not at the end of the stream yet.
522
+ /// This may happen for example because fewer bytes are actually available right now
523
+ /// (e. g. being close to end-of-file) or because read() was interrupted by a signal.
524
+ ///
525
/// No guarantees are provided about the contents of `buf` when this
526
/// function is called, implementations cannot rely on any property of the
527
/// contents of `buf` being true. It is recommended that *implementations*
0 commit comments