Skip to content

Commit

Permalink
Document the ..1 and the "at most" behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Nov 20, 2024
1 parent f7f3672 commit 4efe721
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions design/mvp/Explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -1739,8 +1739,7 @@ in linear memory and the size in elements of the buffer. (See
| Canonical ABI signature | `[future:i32 ptr:i32] -> [i32]` |

where `read-status` is defined as in [`stream.read`](#-streamread)
and `write-status` is defined as in [`stream.write`]. The number of elements
returned when the value is `complete` is always `1`.
and `write-status` is defined as in [`stream.write`].

The `future.{read,write}` built-ins
take the matching [readable or writable end](Async.md#streams-and-futures)
Expand All @@ -1750,6 +1749,11 @@ value was eagerly read or written, a sentinel indicating that the
operation did not complete yet (`blocked`), or a sentinel indicating
that the future is closed (`closed`).

The number of elements returned when the value is `complete` is at most `1`.

The `..1` in the buffer types indicates that these buffers may hold at most
one element.

In the Canonical ABI, the buffer is passed as a pointer to a buffer
in linear memory.
(See [`canon_future_read`] in the Canonical ABI explainer for details.)
Expand Down

0 comments on commit 4efe721

Please sign in to comment.