Expand description
Slab compaction — removes unreferenced drops from a slab without re-reading file contents. Preserves codecs, drop identities, and metadata; only the slab and manifest’s slab index / history change.
§Algorithm
- Parse the source manifest’s prefix (header, flags, metadata reference — these are copied verbatim).
- Walk the metadata blob to find all referenced
DropIds. - Load the source slab, extract referenced drops with their compressed bytes and codec (no decompression needed).
- Build a new slab containing only the referenced drops.
- Re-encode the slab index + history.
- Recompute the Merkle root.
Structs§
- Compaction
Result - Result of compacting an image.
Enums§
- Compaction
Error - Error during compaction.
Functions§
- compact_
image - Compact an image by removing unreferenced drops from its slab. The manifest’s metadata, header, and flags are preserved; only the slab and the slab index / history sections are updated.