From a39776e6fa21c96fb33b52bdeb89d2c8b8f4cca7 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 10 Nov 2023 14:32:05 -0800 Subject: [PATCH] move error resource to its own interface. (#56) * Move error resource to its own interface Two reasons for this design change: it is confusing having one type named stream/stream-error and another named stream/error. this error resource seems useful outside of just streams. Therefore, we are moving it to a separate interface error in the same package. There are no functional changes to this type. The doc comments are now more general. * generate markdown --- imports.md | 46 ++++++++++++++++++++++++++++------------------ wit/error.wit | 34 ++++++++++++++++++++++++++++++++++ wit/streams.wit | 21 +-------------------- 3 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 wit/error.wit diff --git a/imports.md b/imports.md index e08b326..dbca06e 100644 --- a/imports.md +++ b/imports.md @@ -2,11 +2,33 @@ +

Import interface wasi:io/error

+
+

Types

+

resource error

+
+

Functions

+

[method]error.to-debug-string: func

+

Returns a string that is suitable to assist humans in debugging +this error.

+

WARNING: The returned string should not be consumed mechanically! +It may change across platforms, hosts, or other implementation +details. Parsing this string is a major platform-compatibility +hazard.

+
Params
+ +
Return values
+

Import interface wasi:io/poll

A poll API intended to let users wait for I/O events on multiple handles at once.

@@ -64,11 +86,13 @@ stream types.

when it does, they are expected to subsume this API.


Types

-

type pollable

-

pollable

+

type error

+

error

+

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

-#### `resource error` -

variant stream-error

+#### `variant stream-error`

An error for input-stream and output-stream operations.

Variant Cases