All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.caesarealabs.rpc4k.runtime.api.SerializationFormat.kt Maven / Gradle / Ivy

package com.caesarealabs.rpc4k.runtime.api
import com.caesarealabs.rpc4k.runtime.implementation.serializers.*
import io.ktor.http.*
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.json.Json


/**
 * For example [Json] or Protobuf
 * Must use the [Rpc4kSerializersModule]
 */
public interface SerializationFormat {
    public fun  encode(serializer: SerializationStrategy, value: T): ByteArray
    public fun  decode(serializer: DeserializationStrategy, raw: ByteArray): T
    public val contentType: ContentType
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy