mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
net: update try_io docs with interest limitations (#5222)
This commit is contained in:
@@ -964,7 +964,7 @@ impl TcpStream {
|
|||||||
/// Tries to read or write from the socket using a user-provided IO operation.
|
/// Tries 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
|
/// If the socket is ready, the provided closure is called. The closure
|
||||||
/// should attempt to perform IO operation from the socket by manually
|
/// should attempt to perform IO operation on the socket by manually
|
||||||
/// calling the appropriate syscall. If the operation fails because the
|
/// calling the appropriate syscall. If the operation fails because the
|
||||||
/// socket is not actually ready, then the closure should return a
|
/// socket is not actually ready, then the closure should return a
|
||||||
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
||||||
@@ -983,6 +983,11 @@ impl TcpStream {
|
|||||||
/// defined on the Tokio `TcpStream` type, as this will mess with the
|
/// defined on the Tokio `TcpStream` type, as this will mess with the
|
||||||
/// readiness flag and can cause the socket to behave incorrectly.
|
/// readiness flag and can cause the socket to behave incorrectly.
|
||||||
///
|
///
|
||||||
|
/// This method is not intended to be used with combined interests.
|
||||||
|
/// The closure should perform only one type of IO operation, so it should not
|
||||||
|
/// require more than one ready state. This method may panic or sleep forever
|
||||||
|
/// if it is called with a combined interest.
|
||||||
|
///
|
||||||
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
||||||
///
|
///
|
||||||
/// [`readable()`]: TcpStream::readable()
|
/// [`readable()`]: TcpStream::readable()
|
||||||
|
|||||||
@@ -1271,7 +1271,7 @@ impl UdpSocket {
|
|||||||
/// Tries to read or write from the socket using a user-provided IO operation.
|
/// Tries 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
|
/// If the socket is ready, the provided closure is called. The closure
|
||||||
/// should attempt to perform IO operation from the socket by manually
|
/// should attempt to perform IO operation on the socket by manually
|
||||||
/// calling the appropriate syscall. If the operation fails because the
|
/// calling the appropriate syscall. If the operation fails because the
|
||||||
/// socket is not actually ready, then the closure should return a
|
/// socket is not actually ready, then the closure should return a
|
||||||
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
||||||
@@ -1290,6 +1290,11 @@ impl UdpSocket {
|
|||||||
/// defined on the Tokio `UdpSocket` type, as this will mess with the
|
/// defined on the Tokio `UdpSocket` type, as this will mess with the
|
||||||
/// readiness flag and can cause the socket to behave incorrectly.
|
/// readiness flag and can cause the socket to behave incorrectly.
|
||||||
///
|
///
|
||||||
|
/// This method is not intended to be used with combined interests.
|
||||||
|
/// The closure should perform only one type of IO operation, so it should not
|
||||||
|
/// require more than one ready state. This method may panic or sleep forever
|
||||||
|
/// if it is called with a combined interest.
|
||||||
|
///
|
||||||
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
||||||
///
|
///
|
||||||
/// [`readable()`]: UdpSocket::readable()
|
/// [`readable()`]: UdpSocket::readable()
|
||||||
|
|||||||
@@ -1214,7 +1214,7 @@ impl UnixDatagram {
|
|||||||
/// Tries to read or write from the socket using a user-provided IO operation.
|
/// Tries 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
|
/// If the socket is ready, the provided closure is called. The closure
|
||||||
/// should attempt to perform IO operation from the socket by manually
|
/// should attempt to perform IO operation on the socket by manually
|
||||||
/// calling the appropriate syscall. If the operation fails because the
|
/// calling the appropriate syscall. If the operation fails because the
|
||||||
/// socket is not actually ready, then the closure should return a
|
/// socket is not actually ready, then the closure should return a
|
||||||
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
||||||
@@ -1233,6 +1233,11 @@ impl UnixDatagram {
|
|||||||
/// defined on the Tokio `UnixDatagram` type, as this will mess with the
|
/// defined on the Tokio `UnixDatagram` type, as this will mess with the
|
||||||
/// readiness flag and can cause the socket to behave incorrectly.
|
/// readiness flag and can cause the socket to behave incorrectly.
|
||||||
///
|
///
|
||||||
|
/// This method is not intended to be used with combined interests.
|
||||||
|
/// The closure should perform only one type of IO operation, so it should not
|
||||||
|
/// require more than one ready state. This method may panic or sleep forever
|
||||||
|
/// if it is called with a combined interest.
|
||||||
|
///
|
||||||
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
||||||
///
|
///
|
||||||
/// [`readable()`]: UnixDatagram::readable()
|
/// [`readable()`]: UnixDatagram::readable()
|
||||||
|
|||||||
@@ -661,7 +661,7 @@ impl UnixStream {
|
|||||||
/// Tries to read or write from the socket using a user-provided IO operation.
|
/// Tries 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
|
/// If the socket is ready, the provided closure is called. The closure
|
||||||
/// should attempt to perform IO operation from the socket by manually
|
/// should attempt to perform IO operation on the socket by manually
|
||||||
/// calling the appropriate syscall. If the operation fails because the
|
/// calling the appropriate syscall. If the operation fails because the
|
||||||
/// socket is not actually ready, then the closure should return a
|
/// socket is not actually ready, then the closure should return a
|
||||||
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
||||||
@@ -680,6 +680,11 @@ impl UnixStream {
|
|||||||
/// defined on the Tokio `UnixStream` type, as this will mess with the
|
/// defined on the Tokio `UnixStream` type, as this will mess with the
|
||||||
/// readiness flag and can cause the socket to behave incorrectly.
|
/// readiness flag and can cause the socket to behave incorrectly.
|
||||||
///
|
///
|
||||||
|
/// This method is not intended to be used with combined interests.
|
||||||
|
/// The closure should perform only one type of IO operation, so it should not
|
||||||
|
/// require more than one ready state. This method may panic or sleep forever
|
||||||
|
/// if it is called with a combined interest.
|
||||||
|
///
|
||||||
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
||||||
///
|
///
|
||||||
/// [`readable()`]: UnixStream::readable()
|
/// [`readable()`]: UnixStream::readable()
|
||||||
|
|||||||
@@ -828,6 +828,11 @@ impl NamedPipeServer {
|
|||||||
/// methods defined on the Tokio `NamedPipeServer` type, as this will mess with
|
/// methods defined on the Tokio `NamedPipeServer` type, as this will mess with
|
||||||
/// the readiness flag and can cause the pipe to behave incorrectly.
|
/// the readiness flag and can cause the pipe to behave incorrectly.
|
||||||
///
|
///
|
||||||
|
/// This method is not intended to be used with combined interests.
|
||||||
|
/// The closure should perform only one type of IO operation, so it should not
|
||||||
|
/// require more than one ready state. This method may panic or sleep forever
|
||||||
|
/// if it is called with a combined interest.
|
||||||
|
///
|
||||||
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
||||||
///
|
///
|
||||||
/// [`readable()`]: NamedPipeServer::readable()
|
/// [`readable()`]: NamedPipeServer::readable()
|
||||||
@@ -1567,6 +1572,11 @@ impl NamedPipeClient {
|
|||||||
/// defined on the Tokio `NamedPipeClient` type, as this will mess with the
|
/// defined on the Tokio `NamedPipeClient` type, as this will mess with the
|
||||||
/// readiness flag and can cause the pipe to behave incorrectly.
|
/// readiness flag and can cause the pipe to behave incorrectly.
|
||||||
///
|
///
|
||||||
|
/// This method is not intended to be used with combined interests.
|
||||||
|
/// The closure should perform only one type of IO operation, so it should not
|
||||||
|
/// require more than one ready state. This method may panic or sleep forever
|
||||||
|
/// if it is called with a combined interest.
|
||||||
|
///
|
||||||
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
||||||
///
|
///
|
||||||
/// [`readable()`]: NamedPipeClient::readable()
|
/// [`readable()`]: NamedPipeClient::readable()
|
||||||
|
|||||||
Reference in New Issue
Block a user