mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
doc: clarify EOF condition for AsyncReadExt::read_buf (#3850)
This commit is contained in:
@@ -108,6 +108,8 @@ cfg_io_util! {
|
|||||||
/// This function does not provide any guarantees about whether it
|
/// This function does not provide any guarantees about whether it
|
||||||
/// completes immediately or asynchronously
|
/// completes immediately or asynchronously
|
||||||
///
|
///
|
||||||
|
/// # Return
|
||||||
|
///
|
||||||
/// If the return value of this method is `Ok(n)`, then it must be
|
/// If the return value of this method is `Ok(n)`, then it must be
|
||||||
/// guaranteed that `0 <= n <= buf.len()`. A nonzero `n` value indicates
|
/// guaranteed that `0 <= n <= buf.len()`. A nonzero `n` value indicates
|
||||||
/// that the buffer `buf` has been filled in with `n` bytes of data from
|
/// that the buffer `buf` has been filled in with `n` bytes of data from
|
||||||
@@ -180,9 +182,14 @@ cfg_io_util! {
|
|||||||
///
|
///
|
||||||
/// # Return
|
/// # Return
|
||||||
///
|
///
|
||||||
/// On a successful read, the number of read bytes is returned. If the
|
/// A nonzero `n` value indicates that the buffer `buf` has been filled
|
||||||
/// supplied buffer is not empty and the function returns `Ok(0)` then
|
/// in with `n` bytes of data from this source. If `n` is `0`, then it
|
||||||
/// the source has reached an "end-of-file" event.
|
/// can indicate one of two scenarios:
|
||||||
|
///
|
||||||
|
/// 1. This reader has reached its "end of file" and will likely no longer
|
||||||
|
/// be able to produce bytes. Note that this does not mean that the
|
||||||
|
/// reader will *always* no longer be able to produce bytes.
|
||||||
|
/// 2. The buffer specified had a remaining capacity of zero.
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user