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)
| 282 | /// The declared state must equal the fold of the log — a remote that sends |
| 283 | /// an inconsistent manifest is broken, and we refuse to plan against it. |
| 284 | pub fn parse_remote_manifest(view: &str, text: &str, url: &str) -> CliResult<ViewManifest> { |
| 285 | let manifest = ViewManifest::parse(text).map_err(|e| CliError::RemoteError { |
| 286 | message: format!("Invalid manifest for view '{}' from remote: {}", view, e), |
| 287 | url: Some(url.to_string()), |
| 288 | })?; |
| 289 | manifest.verify().map_err(|e| CliError::RemoteError { |
| 290 | message: format!("Corrupt manifest for view '{}' from remote: {}", view, e), |
| 291 | url: Some(url.to_string()), |
| 292 | })?; |
| 293 | Ok(manifest) |
| 294 | } |
| 295 | |
| 296 | // Change Data Loading |
| 297 |