Skip to main content

classify_claim

Function classify_claim 

Source
pub fn classify_claim(changed: usize) -> ClaimOutcome
Expand description

Classify an atomic claim attempt from the affected-row count (INV-5).

changed is the number of rows the conditional UPDATE reported modifying:

  • 1ClaimOutcome::Won
  • 0ClaimOutcome::Lost
  • anything else → storage invariant violation; returns Lost conservatively. Adapters should log an internal error when changed > 1.