LIST
Structure kind for lists and arrays of an arbitrary length. Serializers typically encode classes with calls to Encoder.beginCollection and CompositeEncoder.endStructure, writing the elements of the list between these calls. Built-in list serializers treat elements as homogeneous, though application-specific serializers may impose application-specific restrictions on specific LIST types.
Example of such application-specific serialization may be class class ListOfThreeElements() : List<Any>
, for which an author of the serializer knows that while it is List<Any>
, in fact, is always has three elements of a known type (e.g. the first is always a string, the second one is always an int etc.)