pub(super) fn download_catalog_release<FStart, FProgress>(
client: &Client,
plan: &CatalogDownloadPlan,
catalog_temp_path: &Path,
metadata_temp_path: &Path,
on_start: FStart,
on_progress: FProgress,
) -> Result<()>Expand description
Downloads a full catalog snapshot through the two-stage update flow.
The function keeps the refresh sequence strict and explicit:
- download the metadata JSON into
metadata_temp_path - parse the metadata and confirm its
current_hashwhen the plan carries an expected hash - download the compressed catalog snapshot into a sibling
.zsttemp file - decompress the snapshot into
catalog_temp_path - verify the final database hash against the metadata hash
The caller owns the final metadata and catalog temp files. This function only removes the internal compressed snapshot temp file it creates while processing the release.
ยงErrors
Returns an error when the plan is not Full, when either download fails,
when the metadata hash does not match the expected hash, when decompression
fails, or when the final catalog hash check fails.