@@ -702,6 +702,13 @@ impl<T: AsRawFd> AsyncFd<T> {
702
702
/// concurrently with other methods on this struct. This method only
703
703
/// provides shared access to the inner IO resource when handling the
704
704
/// [`AsyncFdReadyGuard`].
705
+ ///
706
+ /// # Cancel safety
707
+ ///
708
+ /// This method is cancel safe. Once a readiness event occurs, the method
709
+ /// will continue to return immediately until the readiness event is
710
+ /// consumed by an attempt to read or write that fails with `WouldBlock` or
711
+ /// `Poll::Pending`.
705
712
#[ allow( clippy:: needless_lifetimes) ] // The lifetime improves rustdoc rendering.
706
713
pub async fn readable < ' a > ( & ' a self ) -> io:: Result < AsyncFdReadyGuard < ' a , T > > {
707
714
self . ready ( Interest :: READABLE ) . await
@@ -713,6 +720,13 @@ impl<T: AsRawFd> AsyncFd<T> {
713
720
///
714
721
/// This method takes `&mut self`, so it is possible to access the inner IO
715
722
/// resource mutably when handling the [`AsyncFdReadyMutGuard`].
723
+ ///
724
+ /// # Cancel safety
725
+ ///
726
+ /// This method is cancel safe. Once a readiness event occurs, the method
727
+ /// will continue to return immediately until the readiness event is
728
+ /// consumed by an attempt to read or write that fails with `WouldBlock` or
729
+ /// `Poll::Pending`.
716
730
#[ allow( clippy:: needless_lifetimes) ] // The lifetime improves rustdoc rendering.
717
731
pub async fn readable_mut < ' a > ( & ' a mut self ) -> io:: Result < AsyncFdReadyMutGuard < ' a , T > > {
718
732
self . ready_mut ( Interest :: READABLE ) . await
@@ -726,6 +740,13 @@ impl<T: AsRawFd> AsyncFd<T> {
726
740
/// concurrently with other methods on this struct. This method only
727
741
/// provides shared access to the inner IO resource when handling the
728
742
/// [`AsyncFdReadyGuard`].
743
+ ///
744
+ /// # Cancel safety
745
+ ///
746
+ /// This method is cancel safe. Once a readiness event occurs, the method
747
+ /// will continue to return immediately until the readiness event is
748
+ /// consumed by an attempt to read or write that fails with `WouldBlock` or
749
+ /// `Poll::Pending`.
729
750
#[ allow( clippy:: needless_lifetimes) ] // The lifetime improves rustdoc rendering.
730
751
pub async fn writable < ' a > ( & ' a self ) -> io:: Result < AsyncFdReadyGuard < ' a , T > > {
731
752
self . ready ( Interest :: WRITABLE ) . await
@@ -737,6 +758,13 @@ impl<T: AsRawFd> AsyncFd<T> {
737
758
///
738
759
/// This method takes `&mut self`, so it is possible to access the inner IO
739
760
/// resource mutably when handling the [`AsyncFdReadyMutGuard`].
761
+ ///
762
+ /// # Cancel safety
763
+ ///
764
+ /// This method is cancel safe. Once a readiness event occurs, the method
765
+ /// will continue to return immediately until the readiness event is
766
+ /// consumed by an attempt to read or write that fails with `WouldBlock` or
767
+ /// `Poll::Pending`.
740
768
#[ allow( clippy:: needless_lifetimes) ] // The lifetime improves rustdoc rendering.
741
769
pub async fn writable_mut < ' a > ( & ' a mut self ) -> io:: Result < AsyncFdReadyMutGuard < ' a , T > > {
742
770
self . ready_mut ( Interest :: WRITABLE ) . await
0 commit comments