diff --git a/proxy.md b/proxy.md index f1a14b0..946e036 100644 --- a/proxy.md +++ b/proxy.md @@ -68,7 +68,7 @@ at once.


Types

resource pollable

-
+

A "pollable" handle.

Functions

poll-list: func

Poll for completion on a set of pollables.

@@ -273,6 +273,13 @@ Further writes are still permitted.

resource input-stream

+

An input bytestream.

+

input-streams are non-blocking to the extent practical on underlying +platforms. I/O operations always return promptly; if fewer bytes are +promptly available than requested, they return the number of bytes promptly +available, which could even be zero. To wait for data to be available, +use the subscribe function to obtain a pollable which can be polled +for using wasi:io/poll.

enum write-error

An error for output-stream operations.

Contrary to input-streams, a closed output-stream is reported using @@ -291,7 +298,13 @@ future operations.

resource output-stream

-
+

An output bytestream.

+

output-streams are non-blocking to the extent practical on +underlying platforms. Except where specified otherwise, I/O operations also +always return promptly, after the number of bytes that can be written +promptly, which could even be zero. To wait for the stream to be ready to +accept data, the subscribe function to obtain a pollable which can be +polled for using wasi:io/poll.

Functions

[method]input-stream.read: func

Perform a non-blocking read from the stream.

@@ -661,368 +674,310 @@ the output stream.

  • protocol-error: string
  • unexpected-error: string
  • -

    type fields

    -

    u32

    -

    -#### `type headers` -[`fields`](#fields) +

    resource fields

    +

    type headers

    +

    fields

    #### `type trailers` [`fields`](#fields)

    -#### `type incoming-stream` -[`input-stream`](#input_stream) -

    -#### `type outgoing-stream` -[`output-stream`](#output_stream) -

    -#### `type future-trailers` -`u32` -

    -#### `type future-write-trailers-result` -`u32` -

    -#### `type incoming-request` -`u32` -

    -#### `type outgoing-request` -`u32` -

    -#### `record request-options` +#### `resource incoming-request` +

    resource outgoing-request

    +

    record request-options

    Record Fields
    -

    type response-outparam

    -

    u32

    -

    -#### `type status-code` -`u16` -

    -#### `type incoming-response` -`u32` -

    -#### `type outgoing-response` -`u32` +

    resource response-outparam

    +

    type status-code

    +

    u16

    -#### `type future-incoming-response` -`u32` -

    ----- +#### `resource incoming-response` +

    resource incoming-body

    +

    resource future-trailers

    +

    resource outgoing-response

    +

    resource outgoing-body

    +

    resource future-incoming-response

    +

    The following block defines a special resource type used by the +wasi:http/outgoing-handler interface to emulate +future<result<response, error>> in advance of Preview3. Given a +future-incoming-response, the client can call the non-blocking get +method to get the result if it is available. If the result is not available, +the client can call listen to get a pollable that can be passed to +wasi:io/poll.poll-list.

    Functions

    -

    drop-fields: func

    +

    [constructor]fields: func

    Params
    -

    new-fields: func

    -
    Params
    -
    Return values
    -

    fields-get: func

    +

    [method]fields.get: func

    Params
    Return values
    -

    fields-set: func

    +

    [method]fields.set: func

    Params
    -

    fields-delete: func

    +

    [method]fields.delete: func

    Params
    -

    fields-append: func

    +

    [method]fields.append: func

    Params
    -

    fields-entries: func

    +

    [method]fields.entries: func

    Params
    Return values
    -

    fields-clone: func

    +

    [method]fields.clone: func

    Params
    Return values
    -

    finish-incoming-stream: func

    -
    Params
    - -
    Return values
    - -

    finish-outgoing-stream: func

    -
    Params
    - -

    finish-outgoing-stream-with-trailers: func

    +

    [method]incoming-request.method: func

    Params
    Return values
    -

    drop-future-trailers: func

    +

    [method]incoming-request.path-with-query: func

    Params
    -

    future-trailers-get: func

    -
    Params
    -
    Return values
    -

    listen-to-future-trailers: func

    +

    [method]incoming-request.scheme: func

    Params
    Return values
    -

    drop-future-write-trailers-result: func

    -
    Params
    - -

    future-write-trailers-result-get: func

    +

    [method]incoming-request.authority: func

    Params
    Return values
    -

    listen-to-future-write-trailers-result: func

    +

    [method]incoming-request.headers: func

    Params
    Return values
    -

    drop-incoming-request: func

    -
    Params
    - -

    drop-outgoing-request: func

    -
    Params
    - -

    incoming-request-method: func

    +

    [method]incoming-request.consume: func

    Params
    Return values
    -

    incoming-request-path-with-query: func

    +

    [constructor]outgoing-request: func

    Params
    Return values
    -

    incoming-request-scheme: func

    +

    [method]outgoing-request.write: func

    Params
    Return values
    -

    incoming-request-authority: func

    +

    [static]response-outparam.set: func

    Params
    -
    Return values
    - -

    incoming-request-headers: func

    +

    [method]incoming-response.status: func

    Params
    Return values
    -

    incoming-request-consume: func

    +

    [method]incoming-response.headers: func

    Params
    Return values
    -

    new-outgoing-request: func

    +

    [method]incoming-response.consume: func

    Params
    Return values
    -

    outgoing-request-write: func

    +

    [method]incoming-body.stream: func

    Params
    Return values
    -

    drop-response-outparam: func

    +

    [static]incoming-body.finish: func

    Params
    -

    set-response-outparam: func

    -
    Params
    -
    Return values
    -

    drop-incoming-response: func

    +

    [method]future-trailers.subscribe: func

    +

    Pollable that resolves when the body has been fully read, and the trailers +are ready to be consumed.

    Params
    -

    drop-outgoing-response: func

    -
    Params
    - -

    incoming-response-status: func

    -
    Params
    -
    Return values
    -

    incoming-response-headers: func

    +

    [method]future-trailers.get: func

    +

    Retrieve reference to trailers, if they are ready.

    Params
    Return values
    -

    incoming-response-consume: func

    +

    [constructor]outgoing-response: func

    Params
    Return values
    -

    new-outgoing-response: func

    +

    [method]outgoing-response.write: func

    +

    Will give the child outgoing-response at most once. subsequent calls will +return an error.

    Params
    Return values
    -

    outgoing-response-write: func

    +

    [method]outgoing-body.write: func

    +

    Will give the child output-stream at most once. subsequent calls will +return an error.

    Params
    Return values
    -

    drop-future-incoming-response: func

    +

    [static]outgoing-body.finish: func

    +

    Finalize an outgoing body, optionally providing trailers. This must be +called to signal that the response is complete. If the outgoing-body is +dropped without calling outgoing-body-finalize, the implementation +should treat the body as corrupted.

    Params
    -

    future-incoming-response-get: func

    +

    [method]future-incoming-response.get: func

    +

    option indicates readiness. +outer result indicates you are allowed to get the +incoming-response-or-error at most once. subsequent calls after ready +will return an error here. +inner result indicates whether the incoming-response was available, or an +error occured.

    Params
    Return values
    -

    listen-to-future-incoming-response: func

    +

    [method]future-incoming-response.subscribe: func

    Params
    Return values

    Import interface wasi:http/outgoing-handler


    @@ -1036,17 +991,20 @@ the output stream.

    #### `type future-incoming-response` [`future-incoming-response`](#future_incoming_response)

    +#### `type error` +[`error`](#error) +

    ----

    Functions

    handle: func

    Params
    Return values

    Export interface wasi:http/incoming-handler


    @@ -1062,6 +1020,6 @@ the output stream.

    handle: func

    Params