Skip to main content

PackageIndex

Type Alias PackageIndex 

Source
pub type PackageIndex = FxMap<String, StoredFile>;
Expand description

Index of all files in a package, keyed by relative path within the package.

Backed by FxMap (foldhash) rather than BTreeMap: the linker iterates this map per package and only two non-hot call sites do keyed lookups (ignored_builds checks for "package.json" and "binding.gyp"). Hash-based lookup is O(1) for those, and the flat-bucket layout deserializes/clones with one allocation instead of one per entry. Iteration order is no longer lexicographic — cache JSON files now ship in hash order, which doesn’t affect any caller (caches are keyed by tarball path, not file content).

Aliased Type§

pub struct PackageIndex { /* private fields */ }