LatticeDotFunSerializer

class LatticeDotFunSerializer<V : Quilted<V>>(vSerializer: KSerializer<V>) : KSerializer<LatticeDotFun<V>>

Custom KSerializer for LatticeDotFun<V>: the same wire layout as DotFunSerializer (Map<Dot, V>), entries emitted in the one canonical Dot order the dot family shares, so two replicas at the same logical state encode to identical bytes whichever way their joins ran.

The sort matters for the same reason it does in DotFunSerializer: LatticeDotFun.join builds a LinkedHashMap whose order depends on which operand was this. All three Map<Dot, V> serializers delegate to CanonicalMapSerializer, so the order is spelled once.

The layout is DotFunSerializer's exactly, so a DotFun<V> blob decodes as a LatticeDotFun<V> and the other way round, with nothing to flag the mismatch. A frame's type is settled by whoever chose the serializer, not by the bytes.

Constructors

Link copied to clipboard
constructor(vSerializer: KSerializer<V>)

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): LatticeDotFun<V>
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: LatticeDotFun<V>)