Skip to main content

Module stream

Module stream 

Source
Expand description

Incremental SSP2 message-stream scanner (SPEC.md §1.4, §8.7).

The envelope grammar is self-delimiting — an 8-byte header, then length-prefixed frames until END — so a byte stream split across arbitrary chunk boundaries (WebSocket messages, §8.7) needs no reassembly protocol beyond concatenation plus this scanner: feed chunks, learn exactly where one complete envelope ends. Used by the native transport for round-response reassembly (the Rust mirror of packages/core/src/stream.ts’s MessageStreamScanner, the TS reference the conformance host uses).

The scanner validates only the 8-byte header (a stream whose header is not a valid SSP2 envelope has no findable end, §8.7 connection-fatal rule) and walks frame length prefixes; full decoding stays with crate::decode_message.

Structs§

MessageStreamScanner
Feed bytes, learn exactly where one complete SSP2 envelope ends.
ScannedMessage
A completed scan: the exact envelope bytes plus any surplus buffered past the END frame.