Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements Cargo's new
sparse-index
RFC (RFC #2789), which has become stable since Rust 1.68 (March 9th, 2023).Cargo plans to make the use of this new protocol be the default for
crates.io
in Rust 1.70 (June 1st, 2023).Because of this, I predict users to start to expect every registry to behave that way quite soon, if it isn't already the case.
This protocol makes working with registries with a very large crate index way snappier for users, because
cargo
can selectively request the metadata for the crates it is specifically interested in for the current operation it is doing, instead of having to bring its local cloned copy of the index up-to-date usinggit
, which can take a significant amount of time for a large crate index, or when the local clone hasn't been updated for a while and the crate index has been very active.The routes for the sparse index API are all under the
/api/v1/sparse/
base path.The
Indexer
trait has been extended a bit, notably to allow retrieving the crate configuration file.Task-list before merging
Etag
andIf-None-Match
supportLast-Modified
andIf-Modified-Since
supportcanonical
field in index configuration file (rust-lang/cargo#10964)