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

Method with_classification

atomic-core/src/change/change.rs:288–301  ·  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

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 {

Calls 1

validate_v2Method · 0.80