Skip to main content

Module stream

Module stream 

Source
Expand description

Streaming multi-file writer — the no-materialisation seam.

write_stream packs ONE named stream; StreamWriter generalises it to a whole tree of streams (tar archives, pipe bundles, network feeds) without ever touching the filesystem: entries are chunked straight off their readers via Chunker::chunk_reader, whose internal buffering is bounded by the chunker’s max chunk size plus one read buffer.

§Tree construction

Entries arrive in arbitrary order; the tree is a nested BTreeMap so directory entries materialise name-sorted at finish. File and symlink inodes are allocated (and pushed) in arrival order; directory inodes are allocated parent-first during finish. The numbering therefore differs from a directory pack of the same tree (where the DFS orders allocation) — the format only requires unique numbers — but the same entry sequence always produces byte-identical images.

Structs§

EntryMeta
One entry’s unix identity, applied to its emitted inode: nanosecond mtime, permission bits, and owner. Replaces the scattered (mtime_ns, perms) pairs — ownership is identity, not an afterthought (the tar headers carry it first-class and the directory writer captures it since v0.3.37).
StreamWriter
Build one .lim image from a sequence of named streams.