Variant

stream-error

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

variant stream-error {
  last-operation-failed(error),
  closed,
}

Cases

CasePayloadDescription
last-operation-failederror

The last operation (a write or flush) failed before completion.

More information is available in the error payload.

After this, the stream will be closed. All future operations return stream-error::closed.

closed—

The stream is closed: no more input will be accepted by the stream. A closed output-stream will return this error on all future operations.