Variant

cas-result

The outcome of a swap.

variant cas-result {
  swapped,
  stale(option​<entry>),
}

Cases

CasePayloadDescription
swappedThe new value was written.
staleoption​<entry>A precondition did not hold; nothing was written. The current entry is returned (none if the key is absent) so the caller can recompute and retry without a separate read.