This PR includes two changes which were first made over in Wasmtime:
The input-stream methods now return the same stream-error, fka write-error, as the output-stream methods. This change does eliminate the expression of input-stream.read to indicate both a successful read has completed, and the end of stream being reached. While that corner case will now take one additional call to read, the ergonomics are better and reflect what many client apis expect in e.g. libc. It also allows us to unify on one single stream-error type being returned across all input-stream and output-stream methods. We found that the implementation and tests changes for this interface change made both seem nicer, subjectively.
This PR includes two changes which were first made over in Wasmtime:
The
input-stream
methods now return the samestream-error
, fkawrite-error
, as theoutput-stream
methods. This change does eliminate the expression of input-stream.read to indicate both a successful read has completed, and the end of stream being reached. While that corner case will now take one additional call toread
, the ergonomics are better and reflect what many client apis expect in e.g. libc. It also allows us to unify on one singlestream-error
type being returned across all input-stream and output-stream methods. We found that the implementation and tests changes for this interface change made both seem nicer, subjectively.stream-error
'slast-operation-failed
variant now contains a payloadresource error
. This implements the change described in https://github.com/WebAssembly/wasi-io/issues/47.