Set all hashed lifecycle/origin facts and validate them together.
(
mut self,
kind: ChangeKind,
supersedes: Option<Hash>,
origin: ChangeOrigin,
causal_frontier: CausalFrontier,
)
| 286 | |
| 287 | /// Set all hashed lifecycle/origin facts and validate them together. |
| 288 | pub fn with_classification( |
| 289 | mut self, |
| 290 | kind: ChangeKind, |
| 291 | supersedes: Option<Hash>, |
| 292 | origin: ChangeOrigin, |
| 293 | causal_frontier: CausalFrontier, |
| 294 | ) -> Result<Self, ChangeValidationError> { |
| 295 | self.hashed.kind = kind; |
| 296 | self.hashed.supersedes = supersedes; |
| 297 | self.hashed.origin = origin; |
| 298 | self.hashed.causal_frontier = causal_frontier; |
| 299 | self.hashed.validate_v2()?; |
| 300 | Ok(self) |
| 301 | } |
| 302 | |
| 303 | /// Lifecycle class of this change. |
| 304 | pub fn kind(&self) -> &ChangeKind { |