We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c44e14 commit 4266221Copy full SHA for 4266221
futures-util/src/abortable.rs
@@ -78,6 +78,17 @@ pub struct AbortRegistration {
78
pub(crate) inner: Arc<AbortInner>,
79
}
80
81
+impl AbortRegistration {
82
+ /// Create an [`AbortHandle`] from the given [`AbortRegistration`].
83
+ ///
84
+ /// The created [`AbortHandle`] is functionally the same as any other
85
+ /// [`AbortHandle`]s that are associated with the same [`AbortRegistration`],
86
+ /// such as the one created by [`AbortHandle::new_pair`].
87
+ pub fn handle(&self) -> AbortHandle {
88
+ AbortHandle { inner: self.inner.clone() }
89
+ }
90
+}
91
+
92
/// A handle to an `Abortable` task.
93
#[derive(Debug, Clone)]
94
pub struct AbortHandle {
0 commit comments