1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! The output-sink seam shared by both scheduler closures (WPORT-5 R2).
//!
//! [`IoSink`] and [`NullSink`] historically lived in the `threads`-gated `io`
//! module, which left the cooperative (`wasm32`) closure with an unconditional
//! no-op `write_to_io_sink` — the 9-member silent-output class the WPORT-5
//! profile brief documents. Only the sink *vocabulary* moves here: the trait
//! and its null default carry no thread machinery (no rings, no pools, no
//! blocking IO), so the cooperative closure can reach them without pulling in
//! anything from `crate::io`. The `io` module re-exports both names, so every
//! existing threaded import path and `IoSink` impl compiles unchanged.
//!
//! The sink is PUSH-ONLY (NO-POLLING law, `docs/design/beamr/WASM-PORT-ARC.md`
//! §laws): writes flush through [`IoSink::write_stream`]/[`IoSink::write`]
//! synchronously at the writing BIF. No flush timer, no recurring callback,
//! and no buffer-poll exist on any branch of this seam.
/// Output stream tag carried by tagged sink writes (WPORT-5 R2 item 4).
///
/// `Out` is the stdout-flavoured stream (`io:put_chars`, `io:format/3`,
/// `gleam_stdlib` `print`/`println`, `erlang:display/1` on the cooperative
/// path); `Err` is the stderr-flavoured stream (`gleam_stdlib` `print_error`/
/// `println_error`).
/// Output target for `io` module BIFs.
/// Default output sink that intentionally discards all bytes.
;