MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / with_classification

Method with_classification

atomic-core/src/change/change.rs:298–311  ·  view source on GitHub ↗

Set all hashed lifecycle/origin facts and validate them together.

(
        mut self,
        kind: ChangeKind,
        supersedes: Option<Hash>,
        origin: ChangeOrigin,
        causal_frontier: CausalFrontier,
    )

Source from the content-addressed store, hash-verified

296
297 /// Set all hashed lifecycle/origin facts and validate them together.
298 pub fn with_classification(
299 mut self,
300 kind: ChangeKind,
301 supersedes: Option<Hash>,
302 origin: ChangeOrigin,
303 causal_frontier: CausalFrontier,
304 ) -> Result<Self, ChangeValidationError> {
305 self.hashed.kind = kind;
306 self.hashed.supersedes = supersedes;
307 self.hashed.origin = origin;
308 self.hashed.causal_frontier = causal_frontier;
309 self.hashed.validate_v2()?;
310 Ok(self)
311 }
312
313 /// Lifecycle class of this change.
314 pub fn kind(&self) -> &ChangeKind {

Calls 1

validate_v2Method · 0.80