From 8f10d816131868030996b5079fbc632750e69332 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Tue, 13 Jul 2021 14:23:25 +0200 Subject: [PATCH] net: documentation updates (#3944) --- tokio/src/net/tcp/stream.rs | 20 +++++++-------- tokio/src/net/udp.rs | 20 +++++++-------- tokio/src/net/unix/datagram/socket.rs | 20 +++++++-------- tokio/src/net/unix/stream.rs | 20 +++++++-------- tokio/src/net/windows/named_pipe.rs | 36 +++++++++++++-------------- 5 files changed, 58 insertions(+), 58 deletions(-) diff --git a/tokio/src/net/tcp/stream.rs b/tokio/src/net/tcp/stream.rs index daf3dccde7f..34ac6eeb872 100644 --- a/tokio/src/net/tcp/stream.rs +++ b/tokio/src/net/tcp/stream.rs @@ -936,14 +936,14 @@ impl TcpStream { .try_io(Interest::WRITABLE, || (&*self.io).write_vectored(bufs)) } - /// Try to perform IO operation from the socket using a user-provided IO operation. + /// Try to read or write from the socket using a user-provided IO operation. /// - /// If the socket is ready, the provided closure is called. The - /// closure should attempt to perform IO operation from the socket by manually calling the - /// appropriate syscall. If the operation fails because the socket is not - /// actually ready, then the closure should return a `WouldBlock` error and - /// the readiness flag is cleared. The return value of the closure is - /// then returned by `try_io`. + /// If the socket is ready, the provided closure is called. The closure + /// should attempt to perform IO operation from the socket by manually + /// calling the appropriate syscall. If the operation fails because the + /// socket is not actually ready, then the closure should return a + /// `WouldBlock` error and the readiness flag is cleared. The return value + /// of the closure is then returned by `try_io`. /// /// If the socket is not ready, then the closure is not called /// and a `WouldBlock` error is returned. @@ -954,9 +954,9 @@ impl TcpStream { /// incorrectly clear the readiness flag, which can cause the socket to /// behave incorrectly. /// - /// The closure should not perform the read operation using any of the - /// methods defined on the Tokio `TcpStream` type, as this will mess with - /// the readiness flag and can cause the socket to behave incorrectly. + /// The closure should not perform the IO operation using any of the methods + /// defined on the Tokio `TcpStream` type, as this will mess with the + /// readiness flag and can cause the socket to behave incorrectly. /// /// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function. /// diff --git a/tokio/src/net/udp.rs b/tokio/src/net/udp.rs index a47f071d770..75cc6f3def8 100644 --- a/tokio/src/net/udp.rs +++ b/tokio/src/net/udp.rs @@ -1170,14 +1170,14 @@ impl UdpSocket { .try_io(Interest::READABLE, || self.io.recv_from(buf)) } - /// Try to perform IO operation from the socket using a user-provided IO operation. + /// Try to read or write from the socket using a user-provided IO operation. /// - /// If the socket is ready, the provided closure is called. The - /// closure should attempt to perform IO operation from the socket by manually calling the - /// appropriate syscall. If the operation fails because the socket is not - /// actually ready, then the closure should return a `WouldBlock` error and - /// the readiness flag is cleared. The return value of the closure is - /// then returned by `try_io`. + /// If the socket is ready, the provided closure is called. The closure + /// should attempt to perform IO operation from the socket by manually + /// calling the appropriate syscall. If the operation fails because the + /// socket is not actually ready, then the closure should return a + /// `WouldBlock` error and the readiness flag is cleared. The return value + /// of the closure is then returned by `try_io`. /// /// If the socket is not ready, then the closure is not called /// and a `WouldBlock` error is returned. @@ -1188,9 +1188,9 @@ impl UdpSocket { /// incorrectly clear the readiness flag, which can cause the socket to /// behave incorrectly. /// - /// The closure should not perform the read operation using any of the - /// methods defined on the Tokio `UdpSocket` type, as this will mess with - /// the readiness flag and can cause the socket to behave incorrectly. + /// The closure should not perform the IO operation using any of the methods + /// defined on the Tokio `UdpSocket` type, as this will mess with the + /// readiness flag and can cause the socket to behave incorrectly. /// /// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function. /// diff --git a/tokio/src/net/unix/datagram/socket.rs b/tokio/src/net/unix/datagram/socket.rs index c7c6568f21e..7874b8a136a 100644 --- a/tokio/src/net/unix/datagram/socket.rs +++ b/tokio/src/net/unix/datagram/socket.rs @@ -1143,14 +1143,14 @@ impl UnixDatagram { Ok((n, SocketAddr(addr))) } - /// Try to perform IO operation from the socket using a user-provided IO operation. + /// Try to read or write from the socket using a user-provided IO operation. /// - /// If the socket is ready, the provided closure is called. The - /// closure should attempt to perform IO operation from the socket by manually calling the - /// appropriate syscall. If the operation fails because the socket is not - /// actually ready, then the closure should return a `WouldBlock` error and - /// the readiness flag is cleared. The return value of the closure is - /// then returned by `try_io`. + /// If the socket is ready, the provided closure is called. The closure + /// should attempt to perform IO operation from the socket by manually + /// calling the appropriate syscall. If the operation fails because the + /// socket is not actually ready, then the closure should return a + /// `WouldBlock` error and the readiness flag is cleared. The return value + /// of the closure is then returned by `try_io`. /// /// If the socket is not ready, then the closure is not called /// and a `WouldBlock` error is returned. @@ -1161,9 +1161,9 @@ impl UnixDatagram { /// incorrectly clear the readiness flag, which can cause the socket to /// behave incorrectly. /// - /// The closure should not perform the read operation using any of the - /// methods defined on the Tokio `UnixDatagram` type, as this will mess with - /// the readiness flag and can cause the socket to behave incorrectly. + /// The closure should not perform the IO operation using any of the methods + /// defined on the Tokio `UnixDatagram` type, as this will mess with the + /// readiness flag and can cause the socket to behave incorrectly. /// /// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function. /// diff --git a/tokio/src/net/unix/stream.rs b/tokio/src/net/unix/stream.rs index 39f6ee258f7..5837f3673f8 100644 --- a/tokio/src/net/unix/stream.rs +++ b/tokio/src/net/unix/stream.rs @@ -653,14 +653,14 @@ impl UnixStream { .try_io(Interest::WRITABLE, || (&*self.io).write_vectored(buf)) } - /// Try to perform IO operation from the socket using a user-provided IO operation. + /// Try to read or write from the socket using a user-provided IO operation. /// - /// If the socket is ready, the provided closure is called. The - /// closure should attempt to perform IO operation from the socket by manually calling the - /// appropriate syscall. If the operation fails because the socket is not - /// actually ready, then the closure should return a `WouldBlock` error and - /// the readiness flag is cleared. The return value of the closure is - /// then returned by `try_io`. + /// If the socket is ready, the provided closure is called. The closure + /// should attempt to perform IO operation from the socket by manually + /// calling the appropriate syscall. If the operation fails because the + /// socket is not actually ready, then the closure should return a + /// `WouldBlock` error and the readiness flag is cleared. The return value + /// of the closure is then returned by `try_io`. /// /// If the socket is not ready, then the closure is not called /// and a `WouldBlock` error is returned. @@ -671,9 +671,9 @@ impl UnixStream { /// incorrectly clear the readiness flag, which can cause the socket to /// behave incorrectly. /// - /// The closure should not perform the read operation using any of the - /// methods defined on the Tokio `UnixStream` type, as this will mess with - /// the readiness flag and can cause the socket to behave incorrectly. + /// The closure should not perform the IO operation using any of the methods + /// defined on the Tokio `UnixStream` type, as this will mess with the + /// readiness flag and can cause the socket to behave incorrectly. /// /// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function. /// diff --git a/tokio/src/net/windows/named_pipe.rs b/tokio/src/net/windows/named_pipe.rs index 4e7458b58b7..de6ab58cf4d 100644 --- a/tokio/src/net/windows/named_pipe.rs +++ b/tokio/src/net/windows/named_pipe.rs @@ -724,14 +724,14 @@ impl NamedPipeServer { .try_io(Interest::WRITABLE, || (&*self.io).write_vectored(buf)) } - /// Try to perform IO operation from the socket using a user-provided IO operation. + /// Try to read or write from the socket using a user-provided IO operation. /// - /// If the socket is ready, the provided closure is called. The - /// closure should attempt to perform IO operation from the socket by manually calling the - /// appropriate syscall. If the operation fails because the socket is not - /// actually ready, then the closure should return a `WouldBlock` error and - /// the readiness flag is cleared. The return value of the closure is - /// then returned by `try_io`. + /// If the socket is ready, the provided closure is called. The closure + /// should attempt to perform IO operation from the socket by manually + /// calling the appropriate syscall. If the operation fails because the + /// socket is not actually ready, then the closure should return a + /// `WouldBlock` error and the readiness flag is cleared. The return value + /// of the closure is then returned by `try_io`. /// /// If the socket is not ready, then the closure is not called /// and a `WouldBlock` error is returned. @@ -742,7 +742,7 @@ impl NamedPipeServer { /// incorrectly clear the readiness flag, which can cause the socket to /// behave incorrectly. /// - /// The closure should not perform the read operation using any of the + /// The closure should not perform the IO operation using any of the /// methods defined on the Tokio `NamedPipeServer` type, as this will mess with /// the readiness flag and can cause the socket to behave incorrectly. /// @@ -1379,14 +1379,14 @@ impl NamedPipeClient { .try_io(Interest::WRITABLE, || (&*self.io).write_vectored(buf)) } - /// Try to perform IO operation from the socket using a user-provided IO operation. + /// Try to read or write from the socket using a user-provided IO operation. /// - /// If the socket is ready, the provided closure is called. The - /// closure should attempt to perform IO operation from the socket by manually calling the - /// appropriate syscall. If the operation fails because the socket is not - /// actually ready, then the closure should return a `WouldBlock` error and - /// the readiness flag is cleared. The return value of the closure is - /// then returned by `try_io`. + /// If the socket is ready, the provided closure is called. The closure + /// should attempt to perform IO operation from the socket by manually + /// calling the appropriate syscall. If the operation fails because the + /// socket is not actually ready, then the closure should return a + /// `WouldBlock` error and the readiness flag is cleared. The return value + /// of the closure is then returned by `try_io`. /// /// If the socket is not ready, then the closure is not called /// and a `WouldBlock` error is returned. @@ -1397,9 +1397,9 @@ impl NamedPipeClient { /// incorrectly clear the readiness flag, which can cause the socket to /// behave incorrectly. /// - /// The closure should not perform the read operation using any of the - /// methods defined on the Tokio `NamedPipeClient` type, as this will mess with - /// the readiness flag and can cause the socket to behave incorrectly. + /// The closure should not perform the IO operation using any of the methods + /// defined on the Tokio `NamedPipeClient` type, as this will mess with the + /// readiness flag and can cause the socket to behave incorrectly. /// /// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function. ///