@@ -23,15 +23,15 @@ pub trait Context {
23
23
hostcalls:: get_current_time ( ) . unwrap ( )
24
24
}
25
25
26
- fn get_property ( & self , path : Vec < & str > ) -> Option < Bytes > {
26
+ fn get_property ( & self , path : Vec < & str > ) -> Option < ByteString > {
27
27
hostcalls:: get_property ( & path) . unwrap ( )
28
28
}
29
29
30
30
fn set_property ( & self , path : Vec < & str > , value : Option < & [ u8 ] > ) {
31
31
hostcalls:: set_property ( & path, value) . unwrap ( )
32
32
}
33
33
34
- fn get_shared_data ( & self , key : & str ) -> ( Option < Bytes > , Option < u32 > ) {
34
+ fn get_shared_data ( & self , key : & str ) -> ( Option < ByteString > , Option < u32 > ) {
35
35
hostcalls:: get_shared_data ( key) . unwrap ( )
36
36
}
37
37
@@ -47,7 +47,7 @@ pub trait Context {
47
47
hostcalls:: resolve_shared_queue ( vm_id, name) . unwrap ( )
48
48
}
49
49
50
- fn dequeue_shared_queue ( & self , queue_id : u32 ) -> Result < Option < Bytes > > {
50
+ fn dequeue_shared_queue ( & self , queue_id : u32 ) -> Result < Option < ByteString > > {
51
51
hostcalls:: dequeue_shared_queue ( queue_id)
52
52
}
53
53
@@ -75,15 +75,15 @@ pub trait Context {
75
75
) {
76
76
}
77
77
78
- fn get_http_call_response_headers ( & self ) -> Vec < ( String , HeaderValue ) > {
78
+ fn get_http_call_response_headers ( & self ) -> Vec < ( ByteString , ByteString ) > {
79
79
hostcalls:: get_map ( MapType :: HttpCallResponseHeaders ) . unwrap ( )
80
80
}
81
81
82
- fn get_http_call_response_body ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
82
+ fn get_http_call_response_body ( & self , start : usize , max_size : usize ) -> Option < ByteString > {
83
83
hostcalls:: get_buffer ( BufferType :: HttpCallResponseBody , start, max_size) . unwrap ( )
84
84
}
85
85
86
- fn get_http_call_response_trailers ( & self ) -> Vec < ( String , HeaderValue ) > {
86
+ fn get_http_call_response_trailers ( & self ) -> Vec < ( ByteString , ByteString ) > {
87
87
hostcalls:: get_map ( MapType :: HttpCallResponseTrailers ) . unwrap ( )
88
88
}
89
89
@@ -111,7 +111,7 @@ pub trait RootContext: Context {
111
111
true
112
112
}
113
113
114
- fn get_configuration ( & self ) -> Option < Bytes > {
114
+ fn get_configuration ( & self ) -> Option < ByteString > {
115
115
hostcalls:: get_configuration ( ) . unwrap ( )
116
116
}
117
117
@@ -141,7 +141,7 @@ pub trait StreamContext: Context {
141
141
Action :: Continue
142
142
}
143
143
144
- fn get_downstream_data ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
144
+ fn get_downstream_data ( & self , start : usize , max_size : usize ) -> Option < ByteString > {
145
145
hostcalls:: get_buffer ( BufferType :: DownstreamData , start, max_size) . unwrap ( )
146
146
}
147
147
@@ -151,7 +151,7 @@ pub trait StreamContext: Context {
151
151
Action :: Continue
152
152
}
153
153
154
- fn get_upstream_data ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
154
+ fn get_upstream_data ( & self , start : usize , max_size : usize ) -> Option < ByteString > {
155
155
hostcalls:: get_buffer ( BufferType :: UpstreamData , start, max_size) . unwrap ( )
156
156
}
157
157
@@ -165,15 +165,15 @@ pub trait HttpContext: Context {
165
165
Action :: Continue
166
166
}
167
167
168
- fn get_http_request_headers ( & self ) -> Vec < ( String , HeaderValue ) > {
168
+ fn get_http_request_headers ( & self ) -> Vec < ( ByteString , ByteString ) > {
169
169
hostcalls:: get_map ( MapType :: HttpRequestHeaders ) . unwrap ( )
170
170
}
171
171
172
172
fn set_http_request_headers ( & self , headers : Vec < ( & str , & str ) > ) {
173
173
hostcalls:: set_map ( MapType :: HttpRequestHeaders , & headers) . unwrap ( )
174
174
}
175
175
176
- fn get_http_request_header ( & self , name : & str ) -> Option < HeaderValue > {
176
+ fn get_http_request_header ( & self , name : & str ) -> Option < ByteString > {
177
177
hostcalls:: get_map_value ( MapType :: HttpRequestHeaders , & name) . unwrap ( )
178
178
}
179
179
@@ -189,23 +189,23 @@ pub trait HttpContext: Context {
189
189
Action :: Continue
190
190
}
191
191
192
- fn get_http_request_body ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
192
+ fn get_http_request_body ( & self , start : usize , max_size : usize ) -> Option < ByteString > {
193
193
hostcalls:: get_buffer ( BufferType :: HttpRequestBody , start, max_size) . unwrap ( )
194
194
}
195
195
196
196
fn on_http_request_trailers ( & mut self , _num_trailers : usize ) -> Action {
197
197
Action :: Continue
198
198
}
199
199
200
- fn get_http_request_trailers ( & self ) -> Vec < ( String , HeaderValue ) > {
200
+ fn get_http_request_trailers ( & self ) -> Vec < ( ByteString , ByteString ) > {
201
201
hostcalls:: get_map ( MapType :: HttpRequestTrailers ) . unwrap ( )
202
202
}
203
203
204
204
fn set_http_request_trailers ( & self , trailers : Vec < ( & str , & str ) > ) {
205
205
hostcalls:: set_map ( MapType :: HttpRequestTrailers , & trailers) . unwrap ( )
206
206
}
207
207
208
- fn get_http_request_trailer ( & self , name : & str ) -> Option < HeaderValue > {
208
+ fn get_http_request_trailer ( & self , name : & str ) -> Option < ByteString > {
209
209
hostcalls:: get_map_value ( MapType :: HttpRequestTrailers , & name) . unwrap ( )
210
210
}
211
211
@@ -225,15 +225,15 @@ pub trait HttpContext: Context {
225
225
Action :: Continue
226
226
}
227
227
228
- fn get_http_response_headers ( & self ) -> Vec < ( String , HeaderValue ) > {
228
+ fn get_http_response_headers ( & self ) -> Vec < ( ByteString , ByteString ) > {
229
229
hostcalls:: get_map ( MapType :: HttpResponseHeaders ) . unwrap ( )
230
230
}
231
231
232
232
fn set_http_response_headers ( & self , headers : Vec < ( & str , & str ) > ) {
233
233
hostcalls:: set_map ( MapType :: HttpResponseHeaders , & headers) . unwrap ( )
234
234
}
235
235
236
- fn get_http_response_header ( & self , name : & str ) -> Option < HeaderValue > {
236
+ fn get_http_response_header ( & self , name : & str ) -> Option < ByteString > {
237
237
hostcalls:: get_map_value ( MapType :: HttpResponseHeaders , & name) . unwrap ( )
238
238
}
239
239
@@ -249,23 +249,23 @@ pub trait HttpContext: Context {
249
249
Action :: Continue
250
250
}
251
251
252
- fn get_http_response_body ( & self , start : usize , max_size : usize ) -> Option < Bytes > {
252
+ fn get_http_response_body ( & self , start : usize , max_size : usize ) -> Option < ByteString > {
253
253
hostcalls:: get_buffer ( BufferType :: HttpResponseBody , start, max_size) . unwrap ( )
254
254
}
255
255
256
256
fn on_http_response_trailers ( & mut self , _num_trailers : usize ) -> Action {
257
257
Action :: Continue
258
258
}
259
259
260
- fn get_http_response_trailers ( & self ) -> Vec < ( String , HeaderValue ) > {
260
+ fn get_http_response_trailers ( & self ) -> Vec < ( ByteString , ByteString ) > {
261
261
hostcalls:: get_map ( MapType :: HttpResponseTrailers ) . unwrap ( )
262
262
}
263
263
264
264
fn set_http_response_trailers ( & self , headers : Vec < ( & str , & str ) > ) {
265
265
hostcalls:: set_map ( MapType :: HttpResponseTrailers , & headers) . unwrap ( )
266
266
}
267
267
268
- fn get_http_response_trailer ( & self , name : & str ) -> Option < HeaderValue > {
268
+ fn get_http_response_trailer ( & self , name : & str ) -> Option < ByteString > {
269
269
hostcalls:: get_map_value ( MapType :: HttpResponseTrailers , & name) . unwrap ( )
270
270
}
271
271
0 commit comments