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

doc: Add Cancel safety description for AsyncFd's methods #6662

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

howjmay
Copy link

@howjmay howjmay commented Jun 27, 2024

closes #6654

@@ -700,6 +700,7 @@ impl<T: AsRawFd> AsyncFd<T> {
/// concurrently with other methods on this struct. This method only
/// provides shared access to the inner IO resource when handling the
/// [`AsyncFdReadyGuard`].
/// This method is cancellation safe.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this information like for other methods. For example, TcpStream::readable does it like this:

Suggested change
/// This method is cancellation safe.
/// # Cancel safety
///
/// This method is cancel safe. Once a readiness event occurs, the method
/// will continue to return immediately until the readiness event is
/// consumed by an attempt to read that fails with `WouldBlock` or
/// `Poll::Pending`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AsyncFd's methods are missing information about cancel safety
2 participants