@@ -87,17 +87,23 @@ impl<'a> AsyncWrite for WriteStream<'a> {
87
87
}
88
88
89
89
fn poll_flush (
90
- self : Pin < & mut Self > ,
91
- _cx : & mut std:: task:: Context < ' _ > ,
90
+ mut self : Pin < & mut Self > ,
91
+ cx : & mut std:: task:: Context < ' _ > ,
92
92
) -> Poll < Result < ( ) , std:: io:: Error > > {
93
- todo ! ( )
93
+ if let Some ( mut req) = self . as_mut ( ) . project ( ) . request . as_pin_mut ( ) {
94
+ let r = ready ! ( req. poll_unpin( cx) ) ;
95
+ self . request = None ;
96
+ Poll :: Ready ( r. map_err ( |e| e. into ( ) ) )
97
+ } else {
98
+ Poll :: Ready ( Ok ( ( ) ) )
99
+ }
94
100
}
95
101
96
102
fn poll_shutdown (
97
103
self : Pin < & mut Self > ,
98
104
_cx : & mut std:: task:: Context < ' _ > ,
99
105
) -> Poll < Result < ( ) , std:: io:: Error > > {
100
- todo ! ( )
106
+ Poll :: Ready ( Ok ( ( ) ) )
101
107
}
102
108
}
103
109
@@ -191,17 +197,23 @@ impl<'a> AsyncWrite for TagWriteStream<'a> {
191
197
}
192
198
193
199
fn poll_flush (
194
- self : Pin < & mut Self > ,
195
- _cx : & mut std:: task:: Context < ' _ > ,
200
+ mut self : Pin < & mut Self > ,
201
+ cx : & mut std:: task:: Context < ' _ > ,
196
202
) -> Poll < Result < ( ) , std:: io:: Error > > {
197
- todo ! ( )
203
+ if let Some ( mut req) = self . as_mut ( ) . project ( ) . request . as_pin_mut ( ) {
204
+ let r = ready ! ( req. poll_unpin( cx) ) ;
205
+ self . request = None ;
206
+ Poll :: Ready ( r. map_err ( |e| e. into ( ) ) )
207
+ } else {
208
+ Poll :: Ready ( Ok ( ( ) ) )
209
+ }
198
210
}
199
211
200
212
fn poll_shutdown (
201
213
self : Pin < & mut Self > ,
202
214
_cx : & mut std:: task:: Context < ' _ > ,
203
215
) -> Poll < Result < ( ) , std:: io:: Error > > {
204
- todo ! ( )
216
+ Poll :: Ready ( Ok ( ( ) ) )
205
217
}
206
218
}
207
219
0 commit comments