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)
| 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. |
| 338 | pub 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 |