aboutsummaryrefslogtreecommitdiff
path: root/src/net/unix/split.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/unix/split.rs')
-rw-r--r--src/net/unix/split.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/net/unix/split.rs b/src/net/unix/split.rs
index d4686c2..816a257 100644
--- a/src/net/unix/split.rs
+++ b/src/net/unix/split.rs
@@ -100,8 +100,12 @@ impl ReadHalf<'_> {
/// # Return
///
/// If data is successfully read, `Ok(n)` is returned, where `n` is the
- /// number of bytes read. `Ok(0)` indicates the stream's read half is closed
- /// and will no longer yield data. If the stream is not ready to read data
+ /// number of bytes read. If `n` is `0`, then it can indicate one of two scenarios:
+ ///
+ /// 1. The stream's read half is closed and will no longer yield data.
+ /// 2. The specified buffer was 0 bytes in length.
+ ///
+ /// If the stream is not ready to read data,
/// `Err(io::ErrorKind::WouldBlock)` is returned.
pub fn try_read(&self, buf: &mut [u8]) -> io::Result<usize> {
self.0.try_read(buf)
@@ -178,6 +182,12 @@ impl WriteHalf<'_> {
/// can be used to concurrently read / write to the same socket on a single
/// task without splitting the socket.
///
+ /// The function may complete without the socket being ready. This is a
+ /// false-positive and attempting an operation will return with
+ /// `io::ErrorKind::WouldBlock`. The function can also return with an empty
+ /// [`Ready`] set, so you should always check the returned value and possibly
+ /// wait again if the requested states are not set.
+ ///
/// # Cancel safety
///
/// This method is cancel safe. Once a readiness event occurs, the method