Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io: clarify clear_ready and clear_ready_matching documentation #6304

Merged
merged 5 commits into from
Jan 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions tokio/src/io/async_fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,9 @@ impl<T: AsRawFd> Drop for AsyncFd<T> {
impl<'a, Inner: AsRawFd> AsyncFdReadyGuard<'a, Inner> {
/// Indicates to tokio that the file descriptor is no longer ready. All
/// internal readiness flags will be cleared, and tokio will wait for the
/// next edge-triggered readiness notification from the OS.
/// next readiness notification after the last operation from the OS. This
/// implies that if a readiness notification occurs following the last operation
/// but prior to invoking `clear_ready`, it will not be cleared.
maminrayej marked this conversation as resolved.
Show resolved Hide resolved
///
/// This function is commonly used with guards returned by [`AsyncFd::readable`] and
/// [`AsyncFd::writable`].
Expand All @@ -834,7 +836,9 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyGuard<'a, Inner> {

/// Indicates to tokio that the file descriptor no longer has a specific readiness.
/// The internal readiness flag will be cleared, and tokio will wait for the
/// next edge-triggered readiness notification from the OS.
/// next readiness notification after the last operation from the OS. This
/// implies that if a readiness notification occurs following the last operation
/// but prior to invoking `clear_ready`, it will not be cleared.
///
/// This function is useful in combination with the [`AsyncFd::ready`] method when a
/// combined interest like `Interest::READABLE | Interest::WRITABLE` is used.
Expand Down Expand Up @@ -1033,7 +1037,9 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyGuard<'a, Inner> {
impl<'a, Inner: AsRawFd> AsyncFdReadyMutGuard<'a, Inner> {
/// Indicates to tokio that the file descriptor is no longer ready. All
/// internal readiness flags will be cleared, and tokio will wait for the
/// next edge-triggered readiness notification from the OS.
/// next readiness notification after the last operation from the OS. This
/// implies that if a readiness notification occurs following the last operation
/// but prior to invoking `clear_ready`, it will not be cleared.
///
/// This function is commonly used with guards returned by [`AsyncFd::readable_mut`] and
/// [`AsyncFd::writable_mut`].
Expand All @@ -1050,7 +1056,9 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyMutGuard<'a, Inner> {

/// Indicates to tokio that the file descriptor no longer has a specific readiness.
/// The internal readiness flag will be cleared, and tokio will wait for the
/// next edge-triggered readiness notification from the OS.
/// next readiness notification after the last operation from the OS. This
/// implies that if a readiness notification occurs following the last operation
/// but prior to invoking `clear_ready`, it will not be cleared.
///
/// This function is useful in combination with the [`AsyncFd::ready_mut`] method when a
/// combined interest like `Interest::READABLE | Interest::WRITABLE` is used.
Expand Down
Loading