pub fn poll_for_input(file: &OpenFile, timeout: Duration) -> Result<bool>Expand description
Polls an open file for input readability with a timeout.
Returns Ok(true) if data is available for reading, Ok(false) if the timeout
elapsed without data becoming available.
For regular files, always returns Ok(true) immediately since they’re always
“ready” (matching bash behavior where -t has no effect on regular files).
§Arguments
file- The open file to poll.timeout- Maximum time to wait. UseDuration::ZEROto check without blocking.
§Errors
Returns an error if polling fails or the file descriptor cannot be borrowed.