Provides a custom implementation of stdin to use. By default stdin is closed but an example of using the host's native stdin looks like: ``` use wasmtime_wasi::WasiCtx; use wasmtime_wasi::cli::stdin; let mut wasi = WasiCtx::builder(); wasi.stdin(stdin()); ``` Note that inheriting the process's stdin can also be done through [`inherit_stdin`](WasiCtxBuilder::inherit_stdin).
(&mut self, stdin: impl StdinStream + 'static)
| 82 | /// Note that inheriting the process's stdin can also be done through |
| 83 | /// [`inherit_stdin`](WasiCtxBuilder::inherit_stdin). |
| 84 | pub fn stdin(&mut self, stdin: impl StdinStream + 'static) -> &mut Self { |
| 85 | self.cli.stdin = Box::new(stdin); |
| 86 | self |
| 87 | } |
| 88 | |
| 89 | /// Same as [`stdin`](WasiCtxBuilder::stdin), but for stdout. |
| 90 | pub fn stdout(&mut self, stdout: impl StdoutStream + 'static) -> &mut Self { |