Skip to main content

Module container

Module container 

Source
Expand description

Single-file Pack container.

A Pack is one file: a short header, named sections, and a table of contents at the end. Each section carries its own format version so one part of the Pack can evolve without touching the others. One file is one thing to upload, copy or swap, and readers memory-map it once and hand out borrowed slices per section. Every section carries an XXH3 checksum, so a copy damaged in transit is caught by Container::verify before it is served.

header   magic "OGPACK01" | container version u32 | reserved u32
sections each starts on a 64-byte boundary
toc      varint count, then per section: name, version, offset, length, xxh3
trailer  toc offset u64 | toc length u64 | magic "OGPACKTC"

Structsยง

Bytes
An OwnedBytes simply wraps an object that owns a slice of data and exposes this data as a slice.
Container
Read-only view of a Pack file.
ContainerWriter
SectionInfo