We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b64af3 commit 9c44e14Copy full SHA for 9c44e14
futures-util/src/abortable.rs
@@ -182,4 +182,17 @@ impl AbortHandle {
182
self.inner.aborted.store(true, Ordering::Relaxed);
183
self.inner.waker.wake();
184
}
185
+
186
+ /// Checks whether [`AbortHandle::abort`] was *called* on any associated
187
+ /// [`AbortHandle`]s, which includes all the [`AbortHandle`]s linked with
188
+ /// the same [`AbortRegistration`]. This means that it will return `true`
189
+ /// even if:
190
+ /// * `abort` was called after the task had completed.
191
+ /// * `abort` was called while the task was being polled - the task may still be running and
192
+ /// will not be stopped until `poll` returns.
193
+ ///
194
+ /// This operation has a Relaxed ordering.
195
+ pub fn is_aborted(&self) -> bool {
196
+ self.inner.aborted.load(Ordering::Relaxed)
197
+ }
198
0 commit comments