Construct a snapshot from its parts. The producer computes `own_set_id` (order-invariant over `own_changes`) and `merkle_state` from its engine; this crate carries them opaquely.
(
scope: ViewScopeLabel,
parent_view: Option<String>,
prev: Vec<String>,
own_changes: Vec<String>,
own_set_id: String,
merkle_state: Option<String>,
| 86 | /// (order-invariant over `own_changes`) and `merkle_state` from its engine; |
| 87 | /// this crate carries them opaquely. |
| 88 | pub fn new( |
| 89 | scope: ViewScopeLabel, |
| 90 | parent_view: Option<String>, |
| 91 | prev: Vec<String>, |
| 92 | own_changes: Vec<String>, |
| 93 | own_set_id: String, |
| 94 | merkle_state: Option<String>, |
| 95 | ) -> Self { |
| 96 | ViewSnapshot { |
| 97 | scope: scope.as_str().to_string(), |
| 98 | parent_view, |
| 99 | prev, |
| 100 | own_changes, |
| 101 | own_set_id, |
| 102 | merkle_state, |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | /// Serialize to canonical JSON bytes. Deterministic: struct field order is |
| 107 | /// fixed and every field is deterministic, so the byte output — and thus the |