Expand description
Partial-stream failure semantics for flatwire (checked streams), matching the Python/Node reference. A streamed collection is wrapped in an envelope whose terminal status is written LAST:
{"items":[ e0, e1, ... ],"complete":true}
{"items":[ e0, e1, ... ],"complete":false,"error":{"message":"...","type":"..."}}so a consumer can tell clean completion, an in-band producer error after N
rows, and truncation apart. The wire is plain JSON, so a checked stream
written by any flatwire language decodes here and vice versa. See
docs/FAILURE.md.
Structs§
- Checked
Array Iter - A lazy iterator over the elements of a checked envelope. Each
next()yieldsOk(Value)per element; after the last element the iterator enforces the terminal status, yieldingErr(CheckedError::Stream)if the producer signalledcomplete:falseorErr(CheckedError::Truncated)if the stream ended without a terminal status. A clean stream ends withNoneand no error.
Enums§
- Checked
Error - Outcome of iterating a
CheckedArrayIterto its end, delivered as the terminalErrvariants so a consumer can distinguish the three cases.
Functions§
- decode_
checked_ array - encode_
checked_ array - Stream
itemsinside a checked envelope, writing the terminal status last. If serializing an element fails, acomplete:falsetrailer carrying the error is written before the error is returned, so the consumer can distinguish failure from truncation. Returns the number of elements written.