with
fun with(vararg encoderFunctions: Pair<KClass<*>, TomlEncoder.(kotlinValue: Any) -> TomlValue>): TomlEncoder
Content copied to clipboard
Returns a copy of the target TOML encoder, extended with zero or more additional custom encoder functions. 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.
inline fun <T> with(crossinline encoderFunction: TomlEncoder.(T) -> TomlValue): TomlEncoder
Content copied to clipboard
Returns a copy of the receiver TOML encoder extended with a single custom encoder function, without having to manually specify its target type.