File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -526,7 +526,12 @@ pub trait Read {
526
526
///
527
527
/// 1. This reader has reached its "end of file" and will likely no longer
528
528
/// be able to produce bytes. Note that this does not mean that the
529
- /// reader will *always* no longer be able to produce bytes.
529
+ /// reader will *always* no longer be able to produce bytes. As an example,
530
+ /// on Linux, this method will call the `recv` syscall for a [`TcpStream`],
531
+ /// where returning zero indicates the connection was shut down correctly. While
532
+ /// for [`File`], it is possible to reach the end of file and get zero as result,
533
+ /// but if more data is appended to the file, future calls to `read` will return
534
+ /// more data.
530
535
/// 2. The buffer specified was 0 bytes in length.
531
536
///
532
537
/// It is not an error if the returned value `n` is smaller than the buffer size,
@@ -568,6 +573,7 @@ pub trait Read {
568
573
///
569
574
/// [`Ok(n)`]: Ok
570
575
/// [`File`]: crate::fs::File
576
+ /// [`TcpStream`]: crate::net::TcpStream
571
577
///
572
578
/// ```no_run
573
579
/// use std::io;
You can’t perform that action at this time.
0 commit comments