Skip to main content

evaluate_cas

Function evaluate_cas 

Source
pub fn evaluate_cas(
    current: Option<&[u8]>,
    expectation: RefExpectationWire,
    expected: Option<&[u8]>,
) -> CasDecision
Expand description

Decide a CAS write from its wire form. current is the ref’s value (None when absent) and expected the MATCH target, which must be None for ANY and MISSING. Ids are compared as opaque bytes.

  • ANY always commits.
  • MISSING commits only when current is None.
  • MATCH commits only when current equals expected.