76
76
//! [`RawWaker`]: https://doc.rust-lang.org/std/task/struct.RawWaker.html
77
77
78
78
use std:: {
79
- future:: Future ,
80
79
marker:: PhantomData ,
81
80
ops:: Deref ,
82
81
panic,
@@ -85,14 +84,14 @@ use std::{
85
84
task:: { Context , Poll , Wake } ,
86
85
} ;
87
86
88
- use super :: { RustFutureContinuationCallback , RustFuturePoll , Scheduler } ;
87
+ use super :: { RustFutureContinuationCallback , RustFuturePoll , Scheduler , UniffiCompatibleFuture } ;
89
88
use crate :: { rust_call_with_out_status, FfiDefault , LiftArgsError , LowerReturn , RustCallStatus } ;
90
89
91
90
/// Wraps the actual future we're polling
92
91
struct WrappedFuture < F , T , UT >
93
92
where
94
93
// See rust_future_new for an explanation of these trait bounds
95
- F : Future < Output = Result < T , LiftArgsError > > + Send + ' static ,
94
+ F : UniffiCompatibleFuture < Result < T , LiftArgsError > > + ' static ,
96
95
T : LowerReturn < UT > + Send + ' static ,
97
96
UT : Send + ' static ,
98
97
{
@@ -106,7 +105,7 @@ where
106
105
impl < F , T , UT > WrappedFuture < F , T , UT >
107
106
where
108
107
// See rust_future_new for an explanation of these trait bounds
109
- F : Future < Output = Result < T , LiftArgsError > > + Send + ' static ,
108
+ F : UniffiCompatibleFuture < Result < T , LiftArgsError > > + ' static ,
110
109
T : LowerReturn < UT > + Send + ' static ,
111
110
UT : Send + ' static ,
112
111
{
@@ -186,7 +185,7 @@ where
186
185
unsafe impl < F , T , UT > Send for WrappedFuture < F , T , UT >
187
186
where
188
187
// See rust_future_new for an explanation of these trait bounds
189
- F : Future < Output = Result < T , LiftArgsError > > + Send + ' static ,
188
+ F : UniffiCompatibleFuture < Result < T , LiftArgsError > > + ' static ,
190
189
T : LowerReturn < UT > + Send + ' static ,
191
190
UT : Send + ' static ,
192
191
{
@@ -196,7 +195,7 @@ where
196
195
pub ( super ) struct RustFuture < F , T , UT >
197
196
where
198
197
// See rust_future_new for an explanation of these trait bounds
199
- F : Future < Output = Result < T , LiftArgsError > > + Send + ' static ,
198
+ F : UniffiCompatibleFuture < Result < T , LiftArgsError > > + ' static ,
200
199
T : LowerReturn < UT > + Send + ' static ,
201
200
UT : Send + ' static ,
202
201
{
@@ -212,7 +211,7 @@ where
212
211
impl < F , T , UT > RustFuture < F , T , UT >
213
212
where
214
213
// See rust_future_new for an explanation of these trait bounds
215
- F : Future < Output = Result < T , LiftArgsError > > + Send + ' static ,
214
+ F : UniffiCompatibleFuture < Result < T , LiftArgsError > > + ' static ,
216
215
T : LowerReturn < UT > + Send + ' static ,
217
216
UT : Send + ' static ,
218
217
{
@@ -267,7 +266,7 @@ where
267
266
impl < F , T , UT > Wake for RustFuture < F , T , UT >
268
267
where
269
268
// See rust_future_new for an explanation of these trait bounds
270
- F : Future < Output = Result < T , LiftArgsError > > + Send + ' static ,
269
+ F : UniffiCompatibleFuture < Result < T , LiftArgsError > > + ' static ,
271
270
T : LowerReturn < UT > + Send + ' static ,
272
271
UT : Send + ' static ,
273
272
{
@@ -302,7 +301,7 @@ pub trait RustFutureFfi<ReturnType>: Send + Sync {
302
301
impl < F , T , UT > RustFutureFfi < T :: ReturnType > for RustFuture < F , T , UT >
303
302
where
304
303
// See rust_future_new for an explanation of these trait bounds
305
- F : Future < Output = Result < T , LiftArgsError > > + Send + ' static ,
304
+ F : UniffiCompatibleFuture < Result < T , LiftArgsError > > + ' static ,
306
305
T : LowerReturn < UT > + Send + ' static ,
307
306
UT : Send + ' static ,
308
307
{
0 commit comments