module
C0::Stream
Overview
Stream mode: ETB commits for append-only logs.
C0DATA records are start-delimited, so a crashed append leaves a truncated final record that is indistinguishable from a complete one. In stream mode every appended block (one or more records, or an SOH header) is terminated by an ETB commit marker:
[RS]create[US]a1b2c3[ETB][RS]name[US]draft-2[ETB]
A block is complete if and only if it is terminated by ETB.
Stream::Reader exposes only committed data and reports any torn
tail. Stream::Writer appends each block and its ETB as a single
write, and repairs an uncommitted tail before appending — blind
appends after a torn tail are unsafe (a tail ending in a bare DLE
would escape the next append's RS and fuse two records).