pub async fn poll_io<P, F, T, E>(
pollable: &P,
events: IoEvents,
non_blocking: bool,
f: F,
) -> Result<T, E>Expand description
A helper to wrap a synchronous non-blocking I/O function into an asynchronous function.
§Arguments
pollable: The pollable object to register for I/O events.events: The I/O events to wait for.non_blocking: If true, the function returns the caller’s would-block error immediately when the I/O operation would block.f: The synchronous non-blocking I/O function to be wrapped. It should return an error recognized byPollIoError::is_would_blockwhen the operation would block.