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

Function parse_remote_manifest

atomic-cli/src/commands/push/helpers.rs:295–305  ·  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

293/// The declared state must equal the fold of the log — a remote that sends
294/// an inconsistent manifest is broken, and we refuse to plan against it.
295pub fn parse_remote_manifest(view: &str, text: &str, url: &str) -> CliResult<ViewManifest> {
296 let manifest = ViewManifest::parse(text).map_err(|e| CliError::RemoteError {
297 message: format!("Invalid manifest for view '{}' from remote: {}", view, e),
298 url: Some(url.to_string()),
299 })?;
300 manifest.verify().map_err(|e| CliError::RemoteError {
301 message: format!("Corrupt manifest for view '{}' from remote: {}", view, e),
302 url: Some(url.to_string()),
303 })?;
304 Ok(manifest)
305}
306
307// Change Data Loading
308

Calls 2

parseFunction · 0.85
verifyMethod · 0.45