package wasi:io@0.2.0; interface poll { resource pollable { ready: func() -> bool; block: func(); } poll: func(in: list>) -> list; } interface error { resource error { to-debug-string: func() -> string; } } interface streams { use error.{error}; use poll.{pollable}; variant stream-error { last-operation-failed(error), closed, } resource input-stream { read: func(len: u64) -> result, stream-error>; blocking-read: func(len: u64) -> result, stream-error>; skip: func(len: u64) -> result; blocking-skip: func(len: u64) -> result; subscribe: func() -> pollable; } resource output-stream { check-write: func() -> result; write: func(contents: list) -> result<_, stream-error>; blocking-write-and-flush: func(contents: list) -> result<_, stream-error>; flush: func() -> result<_, stream-error>; blocking-flush: func() -> result<_, stream-error>; subscribe: func() -> pollable; write-zeroes: func(len: u64) -> result<_, stream-error>; blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>; splice: func(src: borrow, len: u64) -> result; blocking-splice: func(src: borrow, len: u64) -> result; } }