File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -526,7 +526,12 @@ pub trait Read {
526526 ///
527527 /// 1. This reader has reached its "end of file" and will likely no longer
528528 /// 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.
530535 /// 2. The buffer specified was 0 bytes in length.
531536 ///
532537 /// It is not an error if the returned value `n` is smaller than the buffer size,
@@ -568,6 +573,7 @@ pub trait Read {
568573 ///
569574 /// [`Ok(n)`]: Ok
570575 /// [`File`]: crate::fs::File
576+ /// [`TcpStream`]: crate::net::TcpStream
571577 ///
572578 /// ```no_run
573579 /// use std::io;
You can’t perform that action at this time.
0 commit comments