We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fec12a0 commit 14bf64fCopy full SHA for 14bf64f
gio/src/cancellable.rs
@@ -1,6 +1,6 @@
1
// Take a look at the license at the top of the repository in the LICENSE file.
2
3
-use std::num::NonZeroU64;
+use std::{future::IntoFuture, num::NonZeroU64};
4
5
use futures_channel::oneshot;
6
use futures_core::Future;
@@ -146,6 +146,16 @@ pub trait CancellableExtManual: IsA<Cancellable> {
146
147
impl<O: IsA<Cancellable>> CancellableExtManual for O {}
148
149
+impl IntoFuture for Cancellable {
150
+ type Output = ();
151
+
152
+ type IntoFuture = std::pin::Pin<Box<dyn Future<Output = ()> + Send + Sync + 'static>>;
153
154
+ fn into_future(self) -> Self::IntoFuture {
155
+ self.future()
156
+ }
157
+}
158
159
#[cfg(test)]
160
mod tests {
161
use super::*;
0 commit comments