|
1 |
| -@since(version = 0.3.0-rc-2025-08-15) |
2 |
| -interface stdio { |
3 |
| - @since(version = 0.3.0-rc-2025-08-15) |
4 |
| - enum error-code { |
5 |
| - /// Input/output error |
6 |
| - io, |
7 |
| - /// Invalid or incomplete multibyte or wide character |
8 |
| - illegal-byte-sequence, |
9 |
| - /// Broken pipe |
10 |
| - pipe, |
11 |
| - } |
12 |
| -} |
13 |
| - |
14 | 1 | @since(version = 0.3.0-rc-2025-08-15)
|
15 | 2 | interface stdin {
|
16 |
| - /// Return a stream for reading from stdin. |
17 |
| - /// |
18 |
| - /// This function returns a stream which provides data read from stdin, |
19 |
| - /// and a future to signal read results. |
20 |
| - /// |
21 |
| - /// If the stream's readable end is dropped the future will resolve to success. |
22 |
| - /// |
23 |
| - /// If the stream's writable end is dropped the future will either resolve to |
24 |
| - /// success if stdin was closed by the writer or to an error-code if reading |
25 |
| - /// failed for some other reason. |
26 |
| - /// |
27 |
| - /// Multiple streams may be active at the same time. The behavior of concurrent |
28 |
| - /// reads is implementation-specific. |
29 | 3 | @since(version = 0.3.0-rc-2025-08-15)
|
30 |
| - read-via-stream: func() -> tuple<stream<u8>, future<result<_, error-code>>>; |
| 4 | + get-stdin: func() -> stream<u8>; |
31 | 5 | }
|
32 | 6 |
|
33 | 7 | @since(version = 0.3.0-rc-2025-08-15)
|
34 | 8 | interface stdout {
|
35 |
| - /// Write the given stream to stdout. |
36 |
| - /// |
37 |
| - /// If the stream's writable end is dropped this function will either return |
38 |
| - /// success once the entire contents of the stream have been written or an |
39 |
| - /// error-code representing a failure. |
40 |
| - /// |
41 |
| - /// Otherwise if there is an error the readable end of the stream will be |
42 |
| - /// dropped and this function will return an error-code. |
43 | 9 | @since(version = 0.3.0-rc-2025-08-15)
|
44 |
| - write-via-stream: async func(data: stream<u8>) -> result<_, error-code>; |
| 10 | + set-stdout: func(data: stream<u8>); |
45 | 11 | }
|
46 | 12 |
|
47 | 13 | @since(version = 0.3.0-rc-2025-08-15)
|
48 | 14 | interface stderr {
|
49 |
| - /// Write the given stream to stderr. |
50 |
| - /// |
51 |
| - /// If the stream's writable end is dropped this function will either return |
52 |
| - /// success once the entire contents of the stream have been written or an |
53 |
| - /// error-code representing a failure. |
54 |
| - /// |
55 |
| - /// Otherwise if there is an error the readable end of the stream will be |
56 |
| - /// dropped and this function will return an error-code. |
57 | 15 | @since(version = 0.3.0-rc-2025-08-15)
|
58 |
| - write-via-stream: async func(data: stream<u8>) -> result<_, error-code>; |
| 16 | + set-stderr: func(data: stream<u8>); |
59 | 17 | }
|
0 commit comments