Package-level declarations

Types

Link copied to clipboard
data class GenericMap<K, V>(val map: Map<K, V>)

A wrapper data class for a Map to be serialized with MsgPack format. Without this wrapper, a map will be serialized as an object. This wrapper will serialize the map as a Generic Map extension type.

Link copied to clipboard
class GenericMapExtensionSerializer<K, V>(keySerializer: KSerializer<K>, valueSerializer: KSerializer<V>) : BaseMsgPackExtensionSerializer<GenericMap<K, V>>

A custom serializer for serializing GenericMap instances using the MsgPack format.

Properties

Link copied to clipboard
val EnvSerializer: KSerializer<Map<String, Any>>

MessagePack Serializer for Map

Link copied to clipboard
val msgPack: MsgPack

A lazily initialized MsgPack instance with a custom configuration.

Link copied to clipboard
val NullableKVSerializer: KSerializer<Map<String, Any?>?>

MessagePack Serializer for Map?

Functions

Link copied to clipboard
inline fun <T> msgPackDecode(bytes: ByteArray): Result<T>

Decodes a given msgpack byte array into an object using the reified type's deserializer.

fun <T> msgPackDecode(serializer: DeserializationStrategy<T>, bytes: ByteArray): Result<T>

Decodes a given msgpack byte array into an object using the provided deserializer.

Link copied to clipboard
inline fun <T> msgPackEncode(value: T): ByteArray

Encodes a given object into a msgpack byte array using the reified type's serializer.

fun <T> msgPackEncode(serializer: SerializationStrategy<T>, value: T): ByteArray

Encodes a given object into a msgpack byte array using the provided serializer.

Link copied to clipboard
fun <K, V> Map<K, V>.toGenericMap(): GenericMap<K, V>

Convenience method to wrap a Map in a MsgPack-serializable GenericMap instance.