From 322a94f72f85defc5eed09e31173cd3de922f28f Mon Sep 17 00:00:00 2001 From: Zachary Stewart Date: Fri, 31 Aug 2018 09:00:33 -0400 Subject: [PATCH] Update documentation for AsyncRead and AsyncWrite (#596) tokio-io: update documentation for AsyncRead and AsyncWrite --- tokio-io/src/async_read.rs | 17 +++++++++-------- tokio-io/src/async_write.rs | 15 ++++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/tokio-io/src/async_read.rs b/tokio-io/src/async_read.rs index 740f71c29..03d5ea9f7 100644 --- a/tokio-io/src/async_read.rs +++ b/tokio-io/src/async_read.rs @@ -16,15 +16,16 @@ use split::{ReadHalf, WriteHalf}; /// Specifically, this means that the `read` function will return one of the /// following: /// -/// * `Ok(n)` means that `n` bytes of data was immediately read and placed into -/// the output buffer, where `n` == 0 implies that EOF has been reached. +/// * `Ok(Async::Ready(n))` means that `n` bytes of data was immediately read +/// and placed into the output buffer, where `n` == 0 implies that EOF has +/// been reached. /// -/// * `Err(e) if e.kind() == ErrorKind::WouldBlock` means that no data was read -/// into the buffer provided. The I/O object is not currently readable but may -/// become readable in the future. Most importantly, **the current future's -/// task is scheduled to get unparked when the object is readable**. This -/// means that like `Future::poll` you'll receive a notification when the I/O -/// object is readable again. +/// * `Ok(Async::NotReady)` means that no data was read into the buffer +/// provided. The I/O object is not currently readable but may become readable +/// in the future. Most importantly, **the current future's task is scheduled +/// to get unparked when the object is readable**. This means that like +/// `Future::poll` you'll receive a notification when the I/O object is +/// readable again. /// /// * `Err(e)` for other errors are standard I/O errors coming from the /// underlying object. diff --git a/tokio-io/src/async_write.rs b/tokio-io/src/async_write.rs index 5553650d9..12eab77a6 100644 --- a/tokio-io/src/async_write.rs +++ b/tokio-io/src/async_write.rs @@ -13,14 +13,15 @@ use AsyncRead; /// Specifically, this means that the `write` function will return one of the /// following: /// -/// * `Ok(n)` means that `n` bytes of data was immediately written . +/// * `Ok(Async::Ready(n))` means that `n` bytes of data was immediately +/// written. /// -/// * `Err(e) if e.kind() == ErrorKind::WouldBlock` means that no data was -/// written from the buffer provided. The I/O object is not currently -/// writable but may become writable in the future. Most importantly, **the -/// current future's task is scheduled to get unparked when the object is -/// readable**. This means that like `Future::poll` you'll receive a -/// notification when the I/O object is writable again. +/// * `Ok(Async::NotReady)` means that no data was written from the buffer +/// provided. The I/O object is not currently writable but may become writable +/// in the future. Most importantly, **the current future's task is scheduled +/// to get unparked when the object is readable**. This means that like +/// `Future::poll` you'll receive a notification when the I/O object is +/// writable again. /// /// * `Err(e)` for other errors are standard I/O errors coming from the /// underlying object.