The local `mint_view_snapshot` — the content-addressed snapshot mint (the own-set-id fold matches the server bridge).
(manifest: &ViewManifest, prev: Option<String>)
| 346 | /// The local `mint_view_snapshot` — the content-addressed snapshot mint |
| 347 | /// (the own-set-id fold matches the server bridge). |
| 348 | fn mint_view_snapshot(manifest: &ViewManifest, prev: Option<String>) -> ViewSnapshot { |
| 349 | let own_changes: Vec<String> = manifest.changes.iter().map(|h| h.to_base32()).collect(); |
| 350 | let mut acc = SetId::ZERO; |
| 351 | for hash in &manifest.changes { |
| 352 | acc = acc.add(hash); |
| 353 | } |
| 354 | let own_set_id = acc.to_base32(); |
| 355 | let merkle_state = if manifest.changes.is_empty() { |
| 356 | None |
| 357 | } else { |
| 358 | Some(manifest.state.to_base32()) |
| 359 | }; |
| 360 | let scope = if manifest.scope.is_draft() { |
| 361 | ViewScopeLabel::Draft |
| 362 | } else { |
| 363 | ViewScopeLabel::Shared |
| 364 | }; |
| 365 | ViewSnapshot::new( |
| 366 | scope, |
| 367 | manifest.parent.clone(), |
| 368 | prev.into_iter().collect(), |
| 369 | own_changes, |
| 370 | own_set_id, |
| 371 | merkle_state, |
| 372 | ) |
| 373 | } |
| 374 | |
| 375 | /// The local `load_change_data` — the raw on-disk change bytes (the exact |
| 376 | /// bytes that produced the content hash), with the load+serialize fallback. |