Package-level declarations

Types

Link copied to clipboard

Codec that serializes a T value to a ByteArray payload.

Link copied to clipboard

Bidirectional codec that converts between domain Source values and their serialized Target representations.

Link copied to clipboard
fun interface Decoder<in I, out O>

Converts serialized payloads into strongly typed domain values.

Link copied to clipboard

Contract that supplies default codecs for common scalar values.

Link copied to clipboard
fun interface Encoder<in I, out O>

Converts domain values into a serialized representation.

Link copied to clipboard
typealias StringCodec<T> = Codec<T, String>

Codec that serializes a T value to a String payload.

Functions

Link copied to clipboard

Converts a StringCodec into a ByteArrayCodec using UTF-8 byte conversion.

Link copied to clipboard
inline fun <Source : Any, Target : Any, Source2 : Any> Codec<Source, Target>.unsafeTransformSource(crossinline from: (Source) -> Source2, crossinline to: (Source2) -> Source): Codec<Source2, Target>

Builds a new codec by transforming the decoded source type.

Link copied to clipboard
inline fun <Source : Any, Target : Any, Target2 : Any> Codec<Source, Target>.unsafeTransformTarget(crossinline from: (Target2) -> Target, crossinline to: (Target) -> Target2): Codec<Source, Target2>

Builds a new codec by transforming the encoded target type.