Expand description
Management of the index of a registry source.
This module contains management of the index and various operations, such as actually parsing the index, looking for crates, etc. This is intended to be abstract over remote indices (downloaded via Git or HTTP) and local registry indices (which are all just present on the filesystem).
§How the index works
Here is a simple flow when loading a Summary
(metadata) from the index:
- A query is fired via
RegistryIndex::query_inner
. - Tries loading all summaries via
RegistryIndex::load_summaries
, and under the hood callingSummaries::parse
to parse an index file.- If an on-disk index cache is present, loads it via
Summaries::parse_cache
. - Otherwise goes to the slower path
RegistryData::load
to get the specific index file.
- If an on-disk index cache is present, loads it via
- A
Summary
is now ready in callbackf
inRegistryIndex::query_inner
.
To learn the rationale behind this multi-layer index metadata loading, see the documentation of the on-disk index cache.
Modules§
- cache 🔒
- A layer of on-disk index cache for performance.
Structs§
- Index
Package - A single line in the index representing a single version of a package.
- Index
Package 🔒Minimum - Index
Package 🔒Rust Version - Index
PackageV 🔒 - Registry
Dependency - A dependency as encoded in the
IndexPackage
index JSON. - Registry
Index - Manager for handling the on-disk index.
- Summaries 🔒
- An internal cache of summaries for a particular package.
Enums§
- Index
Summary - A parsed representation of a summary from the index. This is usually parsed from a line from a raw index file, or a JSON blob from on-disk index cache.
- Maybe
Index 🔒Summary - A lazily parsed
IndexSummary
.
Constants§
- INDEX_
V_ 🔒MAX - The maximum schema version of the
v
field in the index this version of cargo understands. SeeIndexPackage::v
for the detail.
Functions§
- default_
true 🔒 - split 🔒
- Like
slice::split
but is optimized by [memchr
].