kotools / types

Explicit types for Kotlin Multiplatform.
https://types.kotools.org
MIT License
90 stars 6 forks source link

✨ New `ZeroAsByteSerializer` type #690

Closed LVMVRQUXL closed 2 months ago

LVMVRQUXL commented 3 months ago

📝 Description

In the types-kotlinx-serialization subproject, we want to introduce the ZeroAsByteSerializer experimental type for serializing the Zero type as Byte. This serializer should be available for all Kotlin platforms.

class ZeroAsByteSerializer : KSerializer<Zero> {
    override val descriptor: SerializerDescriptor

    override fun equals(other: Any?): Boolean
    override fun hashCode(): Int
    override fun serialize(encoder: Encoder, value: Zero)
    override fun deserialize(decoder: Decoder): Zero
    override fun toString(): String
}

Finally, we want to deprecate the KotoolsTypesSerializers.zero experimental property with an error level for using this new serializer instead.

✅ Checklist