Stderr

Queued writes to standard error.

Each call copies one complete payload into a separate 256-KiB host-owned queue and returns immediately. Writes are legal in init!, update!, and tasks, and refused in render!.

Oversized payloads return TooLarge; insufficient free space returns BufferFull. Nothing is partially queued. Accepted writes preserve order and are drained during orderly shutdown, but eventual delivery is not reported. Ordering against compiler dbg, expect, and crash output is undefined.

WriteError : [PermissionDenied, BufferFull, TooLarge, Unavailable]

Why a write to standard error was not queued. This is this module's own WriteError; Files declares a different one under the same name, for the different things a file write can refuse.

BufferFull is the queue having no room for this payload right now, and nothing was queued; the drainer is behind, and the same call may succeed a moment later. TooLarge is a payload bigger than the whole queue, which no amount of draining will ever fit. Unavailable is there being no queue to write into: the reader on the other end has gone away, which is an ordinary way for a pipeline to end, or the host is shutting down.

Writer

Stderr.Writer :: # (opaque)

Opaque standard-error authority supplied by App.Io. Every app may write to standard error; no declaration is needed.

for_host : Authority -> Writer

Private platform construction; no application can manufacture the argument.

line! : Writer, Str => Try({}, WriteError)

Write a string and then a newline.

Legal in init!, update!, and tasks; refused in render!.

The newline is always a single \n, on every platform. The text and its terminator are queued together, so nothing else can land between them. At most 256 kibibytes cross per call, counting the string's UTF-8 bytes and the newline; a longer string is TooLarge and nothing is queued.

write! : Writer, Str => Try({}, WriteError)

Write a string with no newline after it. Bounded exactly as line! is.

Legal in init!, update!, and tasks; refused in render!.

write_bytes! : Writer, List(U8) => Try({}, WriteError)

Write bytes that are not necessarily text.

Legal in init!, update!, and tasks; refused in render!.

The bytes are passed through as they are: no encoding validation, no newline, no translation. Bounded exactly as line! is, counting the length of the list.