MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / parse_remote_manifest

Function parse_remote_manifest

atomic-cli/src/commands/push/helpers.rs:338–348  ·  view source on GitHub ↗

Parse and verify a remote manifest, mapping failures to remote errors. The declared state must equal the fold of the log — a remote that sends an inconsistent manifest is broken, and we refuse to plan against it.

(view: &str, text: &str, url: &str)

Source from the content-addressed store, hash-verified

336/// The declared state must equal the fold of the log — a remote that sends
337/// an inconsistent manifest is broken, and we refuse to plan against it.
338pub fn parse_remote_manifest(view: &str, text: &str, url: &str) -> CliResult<ViewManifest> {
339 let manifest = ViewManifest::parse(text).map_err(|e| CliError::RemoteError {
340 message: format!("Invalid manifest for view '{}' from remote: {}", view, e),
341 url: Some(url.to_string()),
342 })?;
343 manifest.verify().map_err(|e| CliError::RemoteError {
344 message: format!("Corrupt manifest for view '{}' from remote: {}", view, e),
345 url: Some(url.to_string()),
346 })?;
347 Ok(manifest)
348}
349
350// Change Data Loading
351

Calls 2

parseFunction · 0.85
verifyMethod · 0.45