@@ -10,8 +10,8 @@ use crate::{
10
10
use std:: any:: Any ;
11
11
use std:: pin:: Pin ;
12
12
use std:: task;
13
- use wasmtime_wasi:: preview2:: { AbortOnDropJoinHandle , Table , TableError } ;
14
13
use wasmtime:: component:: Resource ;
14
+ use wasmtime_wasi:: preview2:: { AbortOnDropJoinHandle , Table , TableError } ;
15
15
16
16
/// Capture the state necessary for use in the wasi-http API implementation.
17
17
pub struct WasiHttpCtx ;
@@ -144,13 +144,31 @@ pub trait TableHttpExt {
144
144
id : u32 ,
145
145
) -> Result < HostFutureIncomingResponse , TableError > ;
146
146
147
- fn push_incoming_body ( & mut self , body : HostIncomingBody ) -> Result < Resource < IncomingBody > , TableError > ;
148
- fn get_incoming_body ( & mut self , id : & Resource < IncomingBody > ) -> Result < & mut HostIncomingBody , TableError > ;
149
- fn delete_incoming_body ( & mut self , id : Resource < IncomingBody > ) -> Result < HostIncomingBody , TableError > ;
147
+ fn push_incoming_body (
148
+ & mut self ,
149
+ body : HostIncomingBody ,
150
+ ) -> Result < Resource < IncomingBody > , TableError > ;
151
+ fn get_incoming_body (
152
+ & mut self ,
153
+ id : & Resource < IncomingBody > ,
154
+ ) -> Result < & mut HostIncomingBody , TableError > ;
155
+ fn delete_incoming_body (
156
+ & mut self ,
157
+ id : Resource < IncomingBody > ,
158
+ ) -> Result < HostIncomingBody , TableError > ;
150
159
151
- fn push_outgoing_body ( & mut self , body : HostOutgoingBody ) -> Result < Resource < OutgoingBody > , TableError > ;
152
- fn get_outgoing_body ( & mut self , id : & Resource < OutgoingBody > ) -> Result < & mut HostOutgoingBody , TableError > ;
153
- fn delete_outgoing_body ( & mut self , id : Resource < OutgoingBody > ) -> Result < HostOutgoingBody , TableError > ;
160
+ fn push_outgoing_body (
161
+ & mut self ,
162
+ body : HostOutgoingBody ,
163
+ ) -> Result < Resource < OutgoingBody > , TableError > ;
164
+ fn get_outgoing_body (
165
+ & mut self ,
166
+ id : & Resource < OutgoingBody > ,
167
+ ) -> Result < & mut HostOutgoingBody , TableError > ;
168
+ fn delete_outgoing_body (
169
+ & mut self ,
170
+ id : Resource < OutgoingBody > ,
171
+ ) -> Result < HostOutgoingBody , TableError > ;
154
172
155
173
fn push_future_trailers (
156
174
& mut self ,
@@ -256,27 +274,45 @@ impl TableHttpExt for Table {
256
274
self . delete ( id)
257
275
}
258
276
259
- fn push_incoming_body ( & mut self , body : HostIncomingBody ) -> Result < Resource < IncomingBody > , TableError > {
277
+ fn push_incoming_body (
278
+ & mut self ,
279
+ body : HostIncomingBody ,
280
+ ) -> Result < Resource < IncomingBody > , TableError > {
260
281
Ok ( Resource :: new_own ( self . push ( Box :: new ( body) ) ?) )
261
282
}
262
283
263
- fn get_incoming_body ( & mut self , id : & Resource < IncomingBody > ) -> Result < & mut HostIncomingBody , TableError > {
284
+ fn get_incoming_body (
285
+ & mut self ,
286
+ id : & Resource < IncomingBody > ,
287
+ ) -> Result < & mut HostIncomingBody , TableError > {
264
288
self . get_mut ( id. rep ( ) )
265
289
}
266
290
267
- fn delete_incoming_body ( & mut self , id : Resource < IncomingBody > ) -> Result < HostIncomingBody , TableError > {
291
+ fn delete_incoming_body (
292
+ & mut self ,
293
+ id : Resource < IncomingBody > ,
294
+ ) -> Result < HostIncomingBody , TableError > {
268
295
self . delete ( id. rep ( ) )
269
296
}
270
297
271
- fn push_outgoing_body ( & mut self , body : HostOutgoingBody ) -> Result < Resource < OutgoingBody > , TableError > {
298
+ fn push_outgoing_body (
299
+ & mut self ,
300
+ body : HostOutgoingBody ,
301
+ ) -> Result < Resource < OutgoingBody > , TableError > {
272
302
Ok ( Resource :: new_own ( self . push ( Box :: new ( body) ) ?) )
273
303
}
274
304
275
- fn get_outgoing_body ( & mut self , id : & Resource < OutgoingBody > ) -> Result < & mut HostOutgoingBody , TableError > {
305
+ fn get_outgoing_body (
306
+ & mut self ,
307
+ id : & Resource < OutgoingBody > ,
308
+ ) -> Result < & mut HostOutgoingBody , TableError > {
276
309
self . get_mut ( id. rep ( ) )
277
310
}
278
311
279
- fn delete_outgoing_body ( & mut self , id : Resource < OutgoingBody > ) -> Result < HostOutgoingBody , TableError > {
312
+ fn delete_outgoing_body (
313
+ & mut self ,
314
+ id : Resource < OutgoingBody > ,
315
+ ) -> Result < HostOutgoingBody , TableError > {
280
316
self . delete ( id. rep ( ) )
281
317
}
282
318
0 commit comments