diff --git a/wit-0.3.0-draft/types.wit b/wit-0.3.0-draft/types.wit index f0ba605..7a072b6 100644 --- a/wit-0.3.0-draft/types.wit +++ b/wit-0.3.0-draft/types.wit @@ -216,10 +216,10 @@ interface types { /// /// The names and values are always returned in the original casing and in /// the order in which they will be serialized for transport. - entries: func() -> list>; + copy-all: func() -> list>; /// Make a deep copy of the Fields. Equivalent in behavior to calling the - /// `fields` constructor on the return value of `entries`. The resulting + /// `fields` constructor on the return value of `copy-all`. The resulting /// `fields` is mutable. clone: func() -> fields; } @@ -262,14 +262,14 @@ interface types { ) -> tuple>>; /// Get the Method for the Request. - method: func() -> method; + get-method: func() -> method; /// Set the Method for the Request. Fails if the string present in a /// `method.other` argument is not a syntactically valid method. set-method: func(method: method) -> result; /// Get the combination of the HTTP Path and Query for the Request. When /// `none`, this represents an empty Path and empty Query. - path-with-query: func() -> option; + get-path-with-query: func() -> option; /// Set the combination of the HTTP Path and Query for the Request. When /// `none`, this represents an empty Path and empty Query. Fails is the /// string given is not a syntactically valid path and query uri component. @@ -277,7 +277,7 @@ interface types { /// Get the HTTP Related Scheme for the Request. When `none`, the /// implementation may choose an appropriate default scheme. - scheme: func() -> option; + get-scheme: func() -> option; /// Set the HTTP Related Scheme for the Request. When `none`, the /// implementation may choose an appropriate default scheme. Fails if the /// string given is not a syntactically valid uri scheme. @@ -286,7 +286,7 @@ interface types { /// Get the authority of the Request's target URI. A value of `none` may be used /// with Related Schemes which do not require an authority. The HTTP and /// HTTPS schemes always require an authority. - authority: func() -> option; + get-authority: func() -> option; /// Set the authority of the Request's target URI. A value of `none` may be used /// with Related Schemes which do not require an authority. The HTTP and /// HTTPS schemes always require an authority. Fails if the string given is @@ -301,19 +301,19 @@ interface types { /// This `request-options` resource is a child: it must be dropped before /// the parent `request` is dropped, or its ownership is transferred to /// another component by e.g. `handler.handle`. - options: func() -> option; + get-options: func() -> option; /// Get the headers associated with the Request. /// /// The returned `headers` resource is immutable: `set`, `append`, and /// `delete` operations will fail with `header-error.immutable`. - headers: func() -> headers; + get-headers: func() -> headers; /// Get body of the Request. /// /// Stream returned by this method represents the contents of the body. - /// Once the stream is reported as closed, callers should await the returned future - /// to determine whether the body was received successfully. + /// Once the stream is reported as closed, callers should await the returned + /// future to determine whether the body was received successfully. /// The future will only resolve after the stream is reported as closed. /// /// The stream and future returned by this method are children: @@ -327,8 +327,9 @@ interface types { /// - a stream or future returned by a previous call to this method is still open /// - a stream returned by a previous call to this method has reported itself as closed /// Thus there will always be at most one readable stream open for a given body. - /// Each subsequent stream picks up where the last stream left off, up until it is finished. - body: func() -> result, future, error-code>>>>; + /// Each subsequent stream picks up where the previous one left off, + /// continuing until the entire body has been consumed. + consume-body: func() -> result, future, error-code>>>>; } /// Parameters for making an HTTP Request. Each of these parameters is @@ -342,7 +343,7 @@ interface types { constructor(); /// The timeout for the initial connect to the HTTP Server. - connect-timeout: func() -> option; + get-connect-timeout: func() -> option; /// Set the timeout for the initial connect to the HTTP Server. An error /// return value indicates that this timeout is not supported or that this @@ -350,7 +351,7 @@ interface types { set-connect-timeout: func(duration: option) -> result<_, request-options-error>; /// The timeout for receiving the first byte of the Response body. - first-byte-timeout: func() -> option; + get-first-byte-timeout: func() -> option; /// Set the timeout for receiving the first byte of the Response body. An /// error return value indicates that this timeout is not supported or that @@ -359,7 +360,7 @@ interface types { /// The timeout for receiving subsequent chunks of bytes in the Response /// body stream. - between-bytes-timeout: func() -> option; + get-between-bytes-timeout: func() -> option; /// Set the timeout for receiving subsequent chunks of bytes in the Response /// body stream. An error return value indicates that this timeout is not @@ -397,7 +398,7 @@ interface types { ) -> tuple>>; /// Get the HTTP Status Code for the Response. - status-code: func() -> status-code; + get-status-code: func() -> status-code; /// Set the HTTP Status Code for the Response. Fails if the status-code /// given is not a valid http status code. @@ -407,13 +408,13 @@ interface types { /// /// The returned `headers` resource is immutable: `set`, `append`, and /// `delete` operations will fail with `header-error.immutable`. - headers: func() -> headers; + get-headers: func() -> headers; /// Get body of the Response. /// /// Stream returned by this method represents the contents of the body. - /// Once the stream is reported as closed, callers should await the returned future - /// to determine whether the body was received successfully. + /// Once the stream is reported as closed, callers should await the returned + /// future to determine whether the body was received successfully. /// The future will only resolve after the stream is reported as closed. /// /// The stream and future returned by this method are children: @@ -427,7 +428,8 @@ interface types { /// - a stream or future returned by a previous call to this method is still open /// - a stream returned by a previous call to this method has reported itself as closed /// Thus there will always be at most one readable stream open for a given body. - /// Each subsequent stream picks up where the last stream left off, up until it is finished. - body: func() -> result, future, error-code>>>>; + /// Each subsequent stream picks up where the previous one left off, + /// continuing until the entire body has been consumed. + consume-body: func() -> result, future, error-code>>>>; } }