Skip to main content

GCOUNTER_TAG

Constant GCOUNTER_TAG 

Source
pub const GCOUNTER_TAG: &str = "__GCounter";
Expand description

Merge one CRDT field by its convergence rule:

  • Int + Int — a grow-counter, so add (intentionally wrapping/modular);
  • Set + Set — a grow-set, so union (dedup by value);
  • anything else (LWW register: Bool/Text/Float/…) — last writer wins ⇒ take the incoming value. The struct type tag the interpreter uses for a state-based, gossip-safe G-Counter: a map of replica id → that replica's monotonic count. Distinct from a plain counter (a bare Int whose op-based add merge is NOT idempotent under redelivery).