Skip to main content

Module pack

Module pack 

Source
Expand description

Packfile management for efficient storage.

Packfiles bundle multiple objects together with delta compression, achieving 50-70% space savings for repositories with many similar objects.

Structs§

CancellationToken
Cooperative cancellation shared by a caller and a repack operation.
CompactFrameCompression
zstd parameters for one compact metadata frame.
EncodedPackSubset
PackBuilder
Pack builder for creating packfiles.
PackContainerSpec
PackEntryHeader
PackIndex
Pack index for fast object lookup.
PackInventory
Owned disk-backed installed identities. The retained index survives removal of the transfer’s staging directory and is deleted when this value drops.
PackLogicalId
Root-spool-scoped identity of the logical objects in a pack.
PackManager
Format-only coordinator for loaded pack and index files.
PackObjectRecord
PackReader
PackRepresentationHash
Hash of one finalized physical pack representation.
PackStats
Pack statistics.
RepackContext
Cooperative controls supplied to a storage-specific operation.
RepackHandle
Handle for cancellation and result collection.
RepackInventory
Cheap storage facts used to decide whether a repack is worthwhile.
RepackOutcome
Storage-produced measurements, excluding scheduler-owned duration/reason.
RepackPolicy
Configurable automatic repack thresholds.
RepackReport
Completed operation measurements.
RepackResourceLimits
Scheduler-wide resource limits.
RepackScheduler
Bounded background scheduler shared by native and hosted repack payloads.
ScratchDir
Removes its files on normal drop; the lease protects even old scratch from another process’s store-open sweep. The OS releases the lease after a crash.
ScratchLease
A live scratch directory, also usable for caller-owned transfer staging.
StreamingPackBuilder
Streaming pack builder. Held generic over the pack writer (File in production, Cursor<Vec<u8>> in tests).

Enums§

ObjectType
Object type for pack entries.
PackObjectId
PackReadTier
Physical read tier for an indexed pack object.
RepackError
Error returned by scheduling or executing a repack.
RepackReason
The policy signal that caused a background repack.
RepackSchedule
Result of asking the scheduler to start work.

Constants§

PACK_CHECKSUM_LEN
PACK_LOGICAL_ID_CONTEXT
BLAKE3 derive-key context for the canonical logical pack inventory.

Traits§

LoadMonitor
Host-load signal consulted at cooperative checkpoints.
RepackOperation
Storage-specific repack payload driven by the scheduler.
SyncData
Fsync staged pack bytes after finalize flush (Wave 5 L7).

Functions§

append_container_checksum
compress_compact_frame
Compress one compact metadata frame with CompactFrameCompression::DEFAULT.
compress_compact_frame_with
Compress one compact metadata frame with explicit zstd parameters. The raw-when-incompressible rule and the zstd-less fallback are unchanged.
compress_pack_payload
decode_tagged_entry_header
decompress_pack_payload
encode_tagged_entry
encode_tagged_entry_parts
has_zstd_magic
sweep_scratch
Best-effort reclamation at store open. Unknown ages and unavailable locks are kept. Symlinks are never followed. Fresh entries have a full day to finish publishing their lease before they can become sweep candidates.
try_decode_tagged_entry_header
verify_container
verify_container_layout
write_container_header

Type Aliases§

RetainedPackBuild
Pack bytes, index bytes, statistics, and the original uncompressed inputs.