Expand description
Streaming / Infinity mode: ordered frames that reassemble into exactly the canonical image.
A stream is a sequence of self-delimiting frames:
Begin { format version, flags, dialect }
Batch { section id, bytes } (one or more per section, in order)
End { content hash, total size }followed, for incremental updates, by any number of
Delta { operations } (applied to the reassembled module)
End { new content hash }Reassembly is byte-exact: a stream produced from a module yields the same
bytes and the same Blake3 content hash as crate::encode::encode of that module,
because each batch carries a slice of the canonical section image. Deltas are
semantic (root, node content, bindings, annotations, provenance) and are
re-canonicalized after application, so an incremental update also lands on
the identical whole-module encoding.
Every frame carries its own length and a truncated Blake3 checksum, so corruption is detected at the frame boundary instead of surfacing as a confusing parse error later.
Structs§
- Frame
- One stream frame.
- Stream
Decoder - Streaming decoder state.
- Stream
Encoder - Stream encoder facade: prepares frames for a module and for deltas.
- Streamed
Module - A reassembled stream generation.
Enums§
Constants§
- DEFAULT_
CHUNK - Default batch chunk size (bytes of section payload per frame).
- FRAME_
HEADER_ SIZE - Fixed frame header size.
- MAX_
FRAME_ PAYLOAD - Largest frame payload this reader accepts.
- STREAM_
VERSION - Stream frame magic is
AINS; version 1.
Functions§
- aligned_
section_ len - Convenience: number of bytes a generation occupies after padding.
- apply_
delta - Apply delta operations to a module, returning the updated module.
- decode_
stream - Reassemble a whole byte stream into a module.
- delta_
annotations - Test helper: annotations that a delta touched.
- delta_
hash - Apply a list of delta operations and return the re-encoded hash.
- encode_
stream - Encode a module into stream frames.
- encode_
stream_ with - Encode a module into stream frames with explicit encoder options.
- frame_
checksum - Truncated Blake3 checksum of a frame payload.