@@ -240,27 +240,18 @@ interface types {
240
240
/// trailers at any given time.
241
241
resource body {
242
242
243
- /// Construct a new `body` with the specified stream.
243
+ /// Construct a new `body` with the specified stream and `finish` future .
244
244
///
245
- /// This function returns a future, which will resolve
246
- /// to an error code if transmitting stream data fails.
245
+ /// The `finish` future must resolve to a result once `stream` has finished.
247
246
///
248
- /// The returned future resolves to success once body stream
249
- /// is fully transmitted.
250
- new : static func (
251
- %stream : stream <u8 >,
252
- ) -> tuple <body , future <result <_ , error-code >>>;
253
-
254
- /// Construct a new `body` with the specified stream and trailers.
255
- ///
256
- /// This function returns a future, which will resolve
257
- /// to an error code if transmitting stream data or trailers fails.
247
+ /// This function returns a future, which will resolve to an error code if
248
+ /// transmitting of the request or response this body is a part of fails.
258
249
///
259
- /// The returned future resolves to success once body stream and trailers
260
- /// are fully transmitted.
261
- new-with-trailers : static func (
250
+ /// The returned future resolves to success once request or response this
251
+ /// body is a part of is fully transmitted.
252
+ new : static func (
262
253
%stream : stream <u8 >,
263
- trailers : future <trailers >
254
+ finish : future <result < option < trailers >, error-code >>,
264
255
) -> tuple <body , future <result <_ , error-code >>>;
265
256
266
257
/// Returns the contents of the body, as a stream of bytes.
@@ -298,8 +289,7 @@ interface types {
298
289
/// `none` values for `path-with-query` , `scheme` , and `authority` .
299
290
///
300
291
/// * `headers` is the HTTP Headers for the Response.
301
- /// * `body` is the optional contents of the body, possibly including
302
- /// trailers.
292
+ /// * `body` is the contents of the body, possibly including trailers.
303
293
/// * `options` is optional `request-options` to be used if the request is
304
294
/// sent over a network connection.
305
295
///
@@ -310,7 +300,7 @@ interface types {
310
300
/// to reject invalid constructions of `request` .
311
301
constructor (
312
302
headers : headers ,
313
- body : option < body > ,
303
+ body : body ,
314
304
options : option <request-options >
315
305
);
316
306
@@ -424,11 +414,10 @@ interface types {
424
414
/// `set-status-code` method.
425
415
///
426
416
/// * `headers` is the HTTP Headers for the Response.
427
- /// * `body` is the optional contents of the body, possibly including
428
- /// trailers.
417
+ /// * `body` is the contents of the body, possibly including trailers.
429
418
constructor (
430
419
headers : headers ,
431
- body : option < body > ,
420
+ body : body ,
432
421
);
433
422
434
423
/// Get the HTTP Status Code for the Response.
0 commit comments