wasmtime_wasi

Trait StdinStream

Source
pub trait StdinStream: Send {
    // Required methods
    fn stream(&self) -> Box<dyn HostInputStream>;
    fn isatty(&self) -> bool;
}
Expand description

A trait used to represent the standard input to a guest program.

This is used to implement various WASI APIs via the method implementations below.

Built-in implementations are provided for Stdin, pipe::MemoryInputPipe, and pipe::ClosedInputStream.

Required Methods§

Source

fn stream(&self) -> Box<dyn HostInputStream>

Creates a fresh stream which is reading stdin.

Note that the returned stream must share state with all other streams previously created. Guests may create multiple handles to the same stdin and they should all be synchronized in their progress through the program’s input.

Note that this means that if one handle becomes ready for reading they all become ready for reading. Subsequently if one is read from it may mean that all the others are no longer ready for reading. This is basically a consequence of the way the WIT APIs are designed today.

Source

fn isatty(&self) -> bool

Returns whether this stream is backed by a TTY.

Implementors§