RgaOpSerializer
Custom KSerializer for RgaOp<V> that correctly threads vSerializer through to RgaOp.Insert.value, bypassing the limitation in the compiler-generated sealed-class serializer where the V type parameter defaults to PolymorphicSerializer(Any::class).
Use Rga.serializer (which wraps this) rather than constructing this directly.
Wire format: a CBOR/JSON map with a mandatory t (type discriminator) integer field and variant-specific additional fields:
Insert:
{ "t": 0, "id": RgaId, "v": V, "a": RgaId }Remove:
{ "t": 1, "id": RgaId }Compact:
{ "t": 2, "pos": Map<RgaId, RgaId> }
Parameters
vSerializer
the serializer for the element type V.