Build a manifest from parts, computing the state from the log.
(
name: impl Into<String>,
scope: ViewScope,
parent: Option<String>,
changes: Vec<Hash>,
)
| 113 | |
| 114 | /// Build a manifest from parts, computing the state from the log. |
| 115 | pub fn new( |
| 116 | name: impl Into<String>, |
| 117 | scope: ViewScope, |
| 118 | parent: Option<String>, |
| 119 | changes: Vec<Hash>, |
| 120 | ) -> Self { |
| 121 | let state = Self::fold(&changes); |
| 122 | Self { |
| 123 | name: name.into(), |
| 124 | scope, |
| 125 | parent, |
| 126 | changes, |
| 127 | state, |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | /// Verify that the declared state equals the fold of the change log. |
| 132 | pub fn verify(&self) -> Result<(), ManifestError> { |