@@ -21,15 +21,15 @@ pub trait Context {
21
21
hostcalls:: get_current_time ( ) . unwrap ( )
22
22
}
23
23
24
- fn get_property ( & self , path : Vec < & str > ) -> Option < Bytes > {
24
+ fn get_property ( & self , path : Vec < & str > ) -> Option < Vec < u8 > > {
25
25
hostcalls:: get_property ( path) . unwrap ( )
26
26
}
27
27
28
28
fn set_property ( & self , path : Vec < & str > , value : Option < & [ u8 ] > ) {
29
29
hostcalls:: set_property ( path, value) . unwrap ( )
30
30
}
31
31
32
- fn get_shared_data ( & self , key : & str ) -> ( Option < Bytes > , Option < u32 > ) {
32
+ fn get_shared_data ( & self , key : & str ) -> ( Option < Vec < u8 > > , Option < u32 > ) {
33
33
hostcalls:: get_shared_data ( key) . unwrap ( )
34
34
}
35
35
@@ -50,7 +50,7 @@ pub trait Context {
50
50
hostcalls:: resolve_shared_queue ( vm_id, name) . unwrap ( )
51
51
}
52
52
53
- fn dequeue_shared_queue ( & self , queue_id : u32 ) -> Result < Option < Bytes > , Status > {
53
+ fn dequeue_shared_queue ( & self , queue_id : u32 ) -> Result < Option < Vec < u8 > > , Status > {
54
54
hostcalls:: dequeue_shared_queue ( queue_id)
55
55
}
56
56
@@ -82,35 +82,35 @@ pub trait Context {
82
82
hostcalls:: get_map ( MapType :: HttpCallResponseHeaders ) . unwrap ( )
83
83
}
84
84
85
- fn get_http_call_response_headers_bytes ( & self ) -> Vec < ( String , Bytes ) > {
85
+ fn get_http_call_response_headers_bytes ( & self ) -> Vec < ( String , Vec < u8 > ) > {
86
86
hostcalls:: get_map_bytes ( MapType :: HttpCallResponseHeaders ) . unwrap ( )
87
87
}
88
88
89
89
fn get_http_call_response_header ( & self , name : & str ) -> Option < String > {
90
90
hostcalls:: get_map_value ( MapType :: HttpCallResponseHeaders , name) . unwrap ( )
91
91
}
92
92
93
- fn get_http_call_response_header_bytes ( & self , name : & str ) -> Option < Bytes > {
93
+ fn get_http_call_response_header_bytes ( & self , name : & str ) -> Option < Vec < u8 > > {
94
94
hostcalls:: get_map_value_bytes ( MapType :: HttpCallResponseHeaders , name) . unwrap ( )
95
95
}
96
96
97
- fn get_http_call_response_body ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
97
+ fn get_http_call_response_body ( & self , start : usize , max_size : usize ) -> Option < Vec < u8 > > {
98
98
hostcalls:: get_buffer ( BufferType :: HttpCallResponseBody , start, max_size) . unwrap ( )
99
99
}
100
100
101
101
fn get_http_call_response_trailers ( & self ) -> Vec < ( String , String ) > {
102
102
hostcalls:: get_map ( MapType :: HttpCallResponseTrailers ) . unwrap ( )
103
103
}
104
104
105
- fn get_http_call_response_trailers_bytes ( & self ) -> Vec < ( String , Bytes ) > {
105
+ fn get_http_call_response_trailers_bytes ( & self ) -> Vec < ( String , Vec < u8 > ) > {
106
106
hostcalls:: get_map_bytes ( MapType :: HttpCallResponseTrailers ) . unwrap ( )
107
107
}
108
108
109
109
fn get_http_call_response_trailer ( & self , name : & str ) -> Option < String > {
110
110
hostcalls:: get_map_value ( MapType :: HttpCallResponseTrailers , name) . unwrap ( )
111
111
}
112
112
113
- fn get_http_call_response_trailer_bytes ( & self , name : & str ) -> Option < Bytes > {
113
+ fn get_http_call_response_trailer_bytes ( & self , name : & str ) -> Option < Vec < u8 > > {
114
114
hostcalls:: get_map_value_bytes ( MapType :: HttpCallResponseTrailers , name) . unwrap ( )
115
115
}
116
116
@@ -135,7 +135,7 @@ pub trait Context {
135
135
136
136
fn on_grpc_call_response ( & mut self , _token_id : u32 , _status_code : u32 , _response_size : usize ) { }
137
137
138
- fn get_grpc_call_response_body ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
138
+ fn get_grpc_call_response_body ( & self , start : usize , max_size : usize ) -> Option < Vec < u8 > > {
139
139
hostcalls:: get_buffer ( BufferType :: GrpcReceiveBuffer , start, max_size) . unwrap ( )
140
140
}
141
141
@@ -155,11 +155,11 @@ pub trait Context {
155
155
156
156
fn on_grpc_stream_initial_metadata ( & mut self , _token_id : u32 , _num_elements : u32 ) { }
157
157
158
- fn get_grpc_stream_initial_metadata ( & self ) -> Vec < ( String , Bytes ) > {
158
+ fn get_grpc_stream_initial_metadata ( & self ) -> Vec < ( String , Vec < u8 > ) > {
159
159
hostcalls:: get_map_bytes ( MapType :: GrpcReceiveInitialMetadata ) . unwrap ( )
160
160
}
161
161
162
- fn get_grpc_stream_initial_metadata_value ( & self , name : & str ) -> Option < Bytes > {
162
+ fn get_grpc_stream_initial_metadata_value ( & self , name : & str ) -> Option < Vec < u8 > > {
163
163
hostcalls:: get_map_value_bytes ( MapType :: GrpcReceiveInitialMetadata , name) . unwrap ( )
164
164
}
165
165
@@ -169,17 +169,17 @@ pub trait Context {
169
169
170
170
fn on_grpc_stream_message ( & mut self , _token_id : u32 , _message_size : usize ) { }
171
171
172
- fn get_grpc_stream_message ( & mut self , start : usize , max_size : usize ) -> Option < Bytes > {
172
+ fn get_grpc_stream_message ( & mut self , start : usize , max_size : usize ) -> Option < Vec < u8 > > {
173
173
hostcalls:: get_buffer ( BufferType :: GrpcReceiveBuffer , start, max_size) . unwrap ( )
174
174
}
175
175
176
176
fn on_grpc_stream_trailing_metadata ( & mut self , _token_id : u32 , _num_elements : u32 ) { }
177
177
178
- fn get_grpc_stream_trailing_metadata ( & self ) -> Vec < ( String , Bytes ) > {
178
+ fn get_grpc_stream_trailing_metadata ( & self ) -> Vec < ( String , Vec < u8 > ) > {
179
179
hostcalls:: get_map_bytes ( MapType :: GrpcReceiveTrailingMetadata ) . unwrap ( )
180
180
}
181
181
182
- fn get_grpc_stream_trailing_metadata_value ( & self , name : & str ) -> Option < Bytes > {
182
+ fn get_grpc_stream_trailing_metadata_value ( & self , name : & str ) -> Option < Vec < u8 > > {
183
183
hostcalls:: get_map_value_bytes ( MapType :: GrpcReceiveTrailingMetadata , name) . unwrap ( )
184
184
}
185
185
@@ -201,7 +201,7 @@ pub trait Context {
201
201
& self ,
202
202
function_name : & str ,
203
203
arguments : Option < & [ u8 ] > ,
204
- ) -> Result < Option < Bytes > , Status > {
204
+ ) -> Result < Option < Vec < u8 > > , Status > {
205
205
hostcalls:: call_foreign_function ( function_name, arguments)
206
206
}
207
207
@@ -219,15 +219,15 @@ pub trait RootContext: Context {
219
219
true
220
220
}
221
221
222
- fn get_vm_configuration ( & self ) -> Option < Bytes > {
222
+ fn get_vm_configuration ( & self ) -> Option < Vec < u8 > > {
223
223
hostcalls:: get_buffer ( BufferType :: VmConfiguration , 0 , usize:: MAX ) . unwrap ( )
224
224
}
225
225
226
226
fn on_configure ( & mut self , _plugin_configuration_size : usize ) -> bool {
227
227
true
228
228
}
229
229
230
- fn get_plugin_configuration ( & self ) -> Option < Bytes > {
230
+ fn get_plugin_configuration ( & self ) -> Option < Vec < u8 > > {
231
231
hostcalls:: get_buffer ( BufferType :: PluginConfiguration , 0 , usize:: MAX ) . unwrap ( )
232
232
}
233
233
@@ -263,7 +263,7 @@ pub trait StreamContext: Context {
263
263
Action :: Continue
264
264
}
265
265
266
- fn get_downstream_data ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
266
+ fn get_downstream_data ( & self , start : usize , max_size : usize ) -> Option < Vec < u8 > > {
267
267
hostcalls:: get_buffer ( BufferType :: DownstreamData , start, max_size) . unwrap ( )
268
268
}
269
269
@@ -285,7 +285,7 @@ pub trait StreamContext: Context {
285
285
Action :: Continue
286
286
}
287
287
288
- fn get_upstream_data ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
288
+ fn get_upstream_data ( & self , start : usize , max_size : usize ) -> Option < Vec < u8 > > {
289
289
hostcalls:: get_buffer ( BufferType :: UpstreamData , start, max_size) . unwrap ( )
290
290
}
291
291
@@ -315,7 +315,7 @@ pub trait HttpContext: Context {
315
315
hostcalls:: get_map ( MapType :: HttpRequestHeaders ) . unwrap ( )
316
316
}
317
317
318
- fn get_http_request_headers_bytes ( & self ) -> Vec < ( String , Bytes ) > {
318
+ fn get_http_request_headers_bytes ( & self ) -> Vec < ( String , Vec < u8 > ) > {
319
319
hostcalls:: get_map_bytes ( MapType :: HttpRequestHeaders ) . unwrap ( )
320
320
}
321
321
@@ -331,7 +331,7 @@ pub trait HttpContext: Context {
331
331
hostcalls:: get_map_value ( MapType :: HttpRequestHeaders , name) . unwrap ( )
332
332
}
333
333
334
- fn get_http_request_header_bytes ( & self , name : & str ) -> Option < Bytes > {
334
+ fn get_http_request_header_bytes ( & self , name : & str ) -> Option < Vec < u8 > > {
335
335
hostcalls:: get_map_value_bytes ( MapType :: HttpRequestHeaders , name) . unwrap ( )
336
336
}
337
337
@@ -355,7 +355,7 @@ pub trait HttpContext: Context {
355
355
Action :: Continue
356
356
}
357
357
358
- fn get_http_request_body ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
358
+ fn get_http_request_body ( & self , start : usize , max_size : usize ) -> Option < Vec < u8 > > {
359
359
hostcalls:: get_buffer ( BufferType :: HttpRequestBody , start, max_size) . unwrap ( )
360
360
}
361
361
@@ -371,7 +371,7 @@ pub trait HttpContext: Context {
371
371
hostcalls:: get_map ( MapType :: HttpRequestTrailers ) . unwrap ( )
372
372
}
373
373
374
- fn get_http_request_trailers_bytes ( & self ) -> Vec < ( String , Bytes ) > {
374
+ fn get_http_request_trailers_bytes ( & self ) -> Vec < ( String , Vec < u8 > ) > {
375
375
hostcalls:: get_map_bytes ( MapType :: HttpRequestTrailers ) . unwrap ( )
376
376
}
377
377
@@ -387,7 +387,7 @@ pub trait HttpContext: Context {
387
387
hostcalls:: get_map_value ( MapType :: HttpRequestTrailers , name) . unwrap ( )
388
388
}
389
389
390
- fn get_http_request_trailer_bytes ( & self , name : & str ) -> Option < Bytes > {
390
+ fn get_http_request_trailer_bytes ( & self , name : & str ) -> Option < Vec < u8 > > {
391
391
hostcalls:: get_map_value_bytes ( MapType :: HttpRequestTrailers , name) . unwrap ( )
392
392
}
393
393
@@ -423,7 +423,7 @@ pub trait HttpContext: Context {
423
423
hostcalls:: get_map ( MapType :: HttpResponseHeaders ) . unwrap ( )
424
424
}
425
425
426
- fn get_http_response_headers_bytes ( & self ) -> Vec < ( String , Bytes ) > {
426
+ fn get_http_response_headers_bytes ( & self ) -> Vec < ( String , Vec < u8 > ) > {
427
427
hostcalls:: get_map_bytes ( MapType :: HttpResponseHeaders ) . unwrap ( )
428
428
}
429
429
@@ -439,7 +439,7 @@ pub trait HttpContext: Context {
439
439
hostcalls:: get_map_value ( MapType :: HttpResponseHeaders , name) . unwrap ( )
440
440
}
441
441
442
- fn get_http_response_header_bytes ( & self , name : & str ) -> Option < Bytes > {
442
+ fn get_http_response_header_bytes ( & self , name : & str ) -> Option < Vec < u8 > > {
443
443
hostcalls:: get_map_value_bytes ( MapType :: HttpResponseHeaders , name) . unwrap ( )
444
444
}
445
445
@@ -463,7 +463,7 @@ pub trait HttpContext: Context {
463
463
Action :: Continue
464
464
}
465
465
466
- fn get_http_response_body ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
466
+ fn get_http_response_body ( & self , start : usize , max_size : usize ) -> Option < Vec < u8 > > {
467
467
hostcalls:: get_buffer ( BufferType :: HttpResponseBody , start, max_size) . unwrap ( )
468
468
}
469
469
@@ -479,7 +479,7 @@ pub trait HttpContext: Context {
479
479
hostcalls:: get_map ( MapType :: HttpResponseTrailers ) . unwrap ( )
480
480
}
481
481
482
- fn get_http_response_trailers_bytes ( & self ) -> Vec < ( String , Bytes ) > {
482
+ fn get_http_response_trailers_bytes ( & self ) -> Vec < ( String , Vec < u8 > ) > {
483
483
hostcalls:: get_map_bytes ( MapType :: HttpResponseTrailers ) . unwrap ( )
484
484
}
485
485
@@ -495,7 +495,7 @@ pub trait HttpContext: Context {
495
495
hostcalls:: get_map_value ( MapType :: HttpResponseTrailers , name) . unwrap ( )
496
496
}
497
497
498
- fn get_http_response_trailer_bytes ( & self , name : & str ) -> Option < Bytes > {
498
+ fn get_http_response_trailer_bytes ( & self , name : & str ) -> Option < Vec < u8 > > {
499
499
hostcalls:: get_map_value_bytes ( MapType :: HttpResponseTrailers , name) . unwrap ( )
500
500
}
501
501
0 commit comments