This repository was archived by the owner on Nov 25, 2025. It is now read-only.
generated from WebAssembly/wasi-proposal-template
-
Notifications
You must be signed in to change notification settings - Fork 20
[p3] Rename wasi:cli/std{out,err}#set-std{out,err}
#80
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,79 @@ | ||
| @since(version = 0.3.0-rc-2025-08-15) | ||
| interface stdin { | ||
| /// Gets the "stdin" of this component as a stream. | ||
| /// | ||
| /// This function returns a `stream<u8>` which is a byte-based async view | ||
| /// of the stdin to this component. What exactly stdin is depends on the | ||
| /// implementor but it could possibly be backed by any of the following: | ||
| /// | ||
| /// * A console terminal input | ||
| /// * A file via shell redirection | ||
| /// * Another stream from another component in virtualization scenarios | ||
| /// | ||
| /// This function can be called any number of times and all returned streams | ||
| /// will refer to the same I/O object that represents the stdin of this | ||
| /// component itself. Concurrent reads from separate streams are allowed | ||
| /// but it's unspecified which resolves first. | ||
| /// | ||
| /// If a read is started and then cancelled implementors need to guarantee | ||
| /// that no bytes are consumed from stdin. In other words if a read from the | ||
| /// stream returned here initiates a read somewhere else then cancelling | ||
| /// the original read should cancel this other read appropriately or buffer | ||
| /// the results. | ||
| @since(version = 0.3.0-rc-2025-08-15) | ||
| get-stdin: func() -> stream<u8>; | ||
| } | ||
|
|
||
| @since(version = 0.3.0-rc-2025-08-15) | ||
| interface stdout { | ||
| /// Appends the provided stream of data to the "stdout" of this component. | ||
| /// | ||
| /// This function will cause the host/embedder to read from the `data` byte | ||
| /// stream provided and write the output to a component's stdout. What | ||
| /// exactly stdout is depends on the implementor but it could possibly be | ||
| /// backed by any of the following: | ||
| /// | ||
| /// * A console terminal screen | ||
| /// * A file via shell redirection | ||
| /// * Another stream from another component in virtualization scenarios | ||
| /// | ||
| /// Writes to stdout may be blocked if the system is unable to accept and/or | ||
| /// buffer any more bytes from stdout. Implementors are encouraged to only | ||
| /// complete a write once the bytes have been fully flushed out to the | ||
| /// destination in interactive situations as this API is frequently used | ||
| /// for debugging. | ||
| /// | ||
| /// If this function is called multiple times then the true output of this | ||
| /// component will be an interleaving of all the various streams together | ||
| /// as data from them becomes ready. If two streams appended here are ready | ||
| /// at the same time with data then it's not specified which one comes first. | ||
| @since(version = 0.3.0-rc-2025-08-15) | ||
| set-stdout: func(data: stream<u8>); | ||
| append-stdout: func(data: stream<u8>); | ||
| } | ||
|
|
||
| @since(version = 0.3.0-rc-2025-08-15) | ||
| interface stderr { | ||
| /// Appends the provided stream of data to the "stderr" of this component. | ||
| /// | ||
| /// This function will cause the host/embedder to read from the `data` byte | ||
| /// stream provided and write the output to a component's stderr. What | ||
| /// exactly stderr is depends on the implementor but it could possibly be | ||
| /// backed by any of the following: | ||
| /// | ||
| /// * A console terminal screen | ||
| /// * A file via shell redirection | ||
| /// * Another stream from another component in virtualization scenarios | ||
| /// | ||
| /// Writes to stderr may be blocked if the system is unable to accept and/or | ||
| /// buffer any more bytes from stderr. Implementors are encouraged to only | ||
| /// complete a write once the bytes have been fully flushed out to the | ||
| /// destination in interactive situations as this API is frequently used | ||
| /// for debugging. | ||
| /// | ||
| /// If this function is called multiple times then the true output of this | ||
| /// component will be an interleaving of all the various streams together | ||
| /// as data from them becomes ready. If two streams appended here are ready | ||
| /// at the same time with data then it's not specified which one comes first. | ||
| @since(version = 0.3.0-rc-2025-08-15) | ||
| set-stderr: func(data: stream<u8>); | ||
| append-stderr: func(data: stream<u8>); | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "append" mean in this context? If an application calls
append-stdoutmultiple times, how do the different output streams relate?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure yeah, I've expanded the docs a bit