Type Alias wasmtime_wasi::bindings::io::streams::OutputStream

source ·
pub type OutputStream = Box<dyn HostOutputStream>;
Expand description

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.

Dropping an output-stream while there’s still an active write in progress may result in the data being lost. Before dropping the stream, be sure to fully flush your writes.

Aliased Type§

struct OutputStream(/* private fields */);