encoder

inline fun <T : Any> encoder(noinline encoder: TomlEncoder.(kotlinValue: T) -> TomlValue)

Configures a custom encoder function for the given Kotlin type. A custom encoder function is a function from some Kotlin value to a TomlValue. Custom encoder functions are associated with a KClass representing the source type.


fun <T : Any> encoder(kClass: KClass<T>, encoder: TomlEncoder.(kotlinValue: Any) -> TomlValue)