Skip to content

Revise the documentation for WASI 0.3.0's descriptor::read. #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions wit-0.3.0-draft/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,15 @@ interface types {
/// Multiple read, write, and append streams may be active on the same open
/// file and they do not interfere with each other.
///
/// This function returns a future, which will resolve to an error code if
/// reading full contents of the file fails.
/// This function returns a `stream` which provides the data received from the
/// file, and a `future` providing additional error information in case an
/// error is encountered.
///
/// If no error is encountered, `stream.read` on the `stream` will return
/// `read-status::closed` with no `error-context` and the future resolves to
/// the value `ok`. If an error is encounttered, `stream.read` on the
/// `stream` returns `read-status::closed` with an `error-context` and the future
/// resolves to `err` with an `error-code`.
///
/// Note: This is similar to `pread` in POSIX.
@since(version = 0.3.0)
Expand Down