@@ -11,29 +11,29 @@ use std::pin::{self, Pin};
11
11
use crate :: prelude:: * ;
12
12
use crate :: Cancellable ;
13
13
14
- pub struct GioFuture < F , O , T , E > {
14
+ pub struct GioFuture < F , O , T > {
15
15
obj : O ,
16
16
schedule_operation : Option < F > ,
17
17
cancellable : Option < Cancellable > ,
18
- receiver : Option < oneshot:: Receiver < Result < T , E > > > ,
18
+ receiver : Option < oneshot:: Receiver < T > > ,
19
19
}
20
20
21
- pub struct GioFutureResult < T , E > {
22
- sender : oneshot:: Sender < Result < T , E > > ,
21
+ pub struct GioFutureResult < T > {
22
+ sender : oneshot:: Sender < T > ,
23
23
}
24
24
25
- impl < T , E > GioFutureResult < T , E > {
26
- pub fn resolve ( self , res : Result < T , E > ) {
25
+ impl < T > GioFutureResult < T > {
26
+ pub fn resolve ( self , res : T ) {
27
27
let _ = self . sender . send ( res) ;
28
28
}
29
29
}
30
30
31
- impl < F , O , T : ' static , E : ' static > GioFuture < F , O , T , E >
31
+ impl < F , O , T : ' static > GioFuture < F , O , T >
32
32
where
33
33
O : Clone + ' static ,
34
- F : FnOnce ( & O , & Cancellable , GioFutureResult < T , E > ) + ' static ,
34
+ F : FnOnce ( & O , & Cancellable , GioFutureResult < T > ) + ' static ,
35
35
{
36
- pub fn new ( obj : & O , schedule_operation : F ) -> GioFuture < F , O , T , E > {
36
+ pub fn new ( obj : & O , schedule_operation : F ) -> GioFuture < F , O , T > {
37
37
GioFuture {
38
38
obj : obj. clone ( ) ,
39
39
schedule_operation : Some ( schedule_operation) ,
@@ -43,14 +43,14 @@ where
43
43
}
44
44
}
45
45
46
- impl < F , O , T , E > Future for GioFuture < F , O , T , E >
46
+ impl < F , O , T > Future for GioFuture < F , O , T >
47
47
where
48
48
O : Clone + ' static ,
49
- F : FnOnce ( & O , & Cancellable , GioFutureResult < T , E > ) + ' static ,
49
+ F : FnOnce ( & O , & Cancellable , GioFutureResult < T > ) + ' static ,
50
50
{
51
- type Output = Result < T , E > ;
51
+ type Output = T ;
52
52
53
- fn poll ( mut self : pin:: Pin < & mut Self > , ctx : & mut Context ) -> Poll < Result < T , E > > {
53
+ fn poll ( mut self : pin:: Pin < & mut Self > , ctx : & mut Context ) -> Poll < T > {
54
54
let GioFuture {
55
55
ref obj,
56
56
ref mut schedule_operation,
@@ -103,10 +103,10 @@ where
103
103
}
104
104
}
105
105
106
- impl < F , O , T , E > FusedFuture for GioFuture < F , O , T , E >
106
+ impl < F , O , T > FusedFuture for GioFuture < F , O , T >
107
107
where
108
108
O : Clone + ' static ,
109
- F : FnOnce ( & O , & Cancellable , GioFutureResult < T , E > ) + ' static ,
109
+ F : FnOnce ( & O , & Cancellable , GioFutureResult < T > ) + ' static ,
110
110
{
111
111
fn is_terminated ( & self ) -> bool {
112
112
self . schedule_operation . is_none ( )
@@ -117,7 +117,7 @@ where
117
117
}
118
118
}
119
119
120
- impl < F , O , T , E > Drop for GioFuture < F , O , T , E > {
120
+ impl < F , O , T > Drop for GioFuture < F , O , T > {
121
121
fn drop ( & mut self ) {
122
122
if let Some ( cancellable) = self . cancellable . take ( ) {
123
123
cancellable. cancel ( ) ;
@@ -126,4 +126,4 @@ impl<F, O, T, E> Drop for GioFuture<F, O, T, E> {
126
126
}
127
127
}
128
128
129
- impl < F , O , T , E > Unpin for GioFuture < F , O , T , E > { }
129
+ impl < F , O , T > Unpin for GioFuture < F , O , T > { }
0 commit comments