pub trait RegistryQuery {
// Required method
fn published_versions(
&self,
ecosystem: &str,
package: &str,
) -> Result<Vec<String>>;
// Provided method
fn published_checksum(
&self,
ecosystem: &str,
package: &str,
version: &str,
) -> Result<String> { ... }
}Expand description
Queries a package registry for already-published state — the “remote is ground truth” source the release reconciler consults (ADR-0003).
Required Methods§
Provided Methods§
Sourcefn published_checksum(
&self,
ecosystem: &str,
package: &str,
version: &str,
) -> Result<String>
fn published_checksum( &self, ecosystem: &str, package: &str, version: &str, ) -> Result<String>
The registry-recorded content digest of package@version — for crates.io
the sparse-index cksum, the lowercase-hex SHA-256 of the published
.crate tarball.
Used to authenticate an idempotency skip: a resumed publish that finds
the version already on the registry trusts that “already published” answer
only when this digest matches the digest of the artifact the cut would
upload, so the registry’s crate is proven byte-identical to the intended
one before the publish is skipped (see
crate::release::adapters::cargo). Name + version existence alone is not
enough — a different artifact could occupy the version.
Fail-closed, like Self::published_versions. Ok(<hex>) is the
recorded digest; an outage, a version that is not on the index, or a
registry that exposes no digest for the version is an Err — never a
fabricated value that could mask a mismatch as a match. The default
implementation errors (io::ErrorKind::Unsupported): a backend wires this
only for the ecosystems whose skip path is digest-authenticated (crates.io
today), and the sole caller is the cargo adapter’s resume skip.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".