summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZahari Dichev <zaharidichev@gmail.com>2020-10-21 14:32:50 +0300
committerGitHub <noreply@github.com>2020-10-21 13:32:50 +0200
commit8f37544a79ae7c694de6b3b7208ee06bdc86c308 (patch)
tree8cefe7e408831c03623099f9f7151fc5c4e287d3
parent43d071489837a154dd56b42176c637b635e1891f (diff)
io: explain how to determine number of bytes read in AsyncRead (#3011)
Fixes: #2999
-rw-r--r--tokio/src/io/async_read.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/tokio/src/io/async_read.rs b/tokio/src/io/async_read.rs
index 1ca045bd..d075443a 100644
--- a/tokio/src/io/async_read.rs
+++ b/tokio/src/io/async_read.rs
@@ -16,8 +16,9 @@ use std::task::{Context, Poll};
/// the following:
///
/// * `Poll::Ready(Ok(()))` means that data was immediately read and placed into
-/// the output buffer. If no data was read (`buf.filled().is_empty()`) it
-/// implies that EOF has been reached.
+/// the output buffer. The amount of data read can be determined by the
+/// increase in the length of the slice returned by `ReadBuf::filled`. If the
+/// difference is 0, EOF has been reached.
///
/// * `Poll::Pending` means that no data was read into the buffer
/// provided. The I/O object is not currently readable but may become readable