mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
doc: clarify limits on return values of AsyncWrite::poll_write (#3820)
This commit is contained in:
parent
8f6d8b25bf
commit
bdd6765016
@ -45,7 +45,11 @@ use std::task::{Context, Poll};
|
|||||||
pub trait AsyncWrite {
|
pub trait AsyncWrite {
|
||||||
/// Attempt to write bytes from `buf` into the object.
|
/// Attempt to write bytes from `buf` into the object.
|
||||||
///
|
///
|
||||||
/// On success, returns `Poll::Ready(Ok(num_bytes_written))`.
|
/// On success, returns `Poll::Ready(Ok(num_bytes_written))`. If successful,
|
||||||
|
/// then it must be guaranteed that `n <= buf.len()`. A return value of `0`
|
||||||
|
/// typically means that the underlying object is no longer able to accept
|
||||||
|
/// bytes and will likely not be able to in the future as well, or that the
|
||||||
|
/// buffer provided is empty.
|
||||||
///
|
///
|
||||||
/// If the object is not ready for writing, the method returns
|
/// If the object is not ready for writing, the method returns
|
||||||
/// `Poll::Pending` and arranges for the current task (via
|
/// `Poll::Pending` and arranges for the current task (via
|
||||||
|
Loading…
x
Reference in New Issue
Block a user