tomlMapper

Creates a new TOML mapper with the given configuration. In the interest of efficiency, consider creating a mapper once and then keeping it around for the duration of your program, rather than re-creating it every time you need to process a TOML value.


Without any extra configuration, TOML types can be transcoded to/from Kotlin types as follows:

Additionally, any subclass of TomlValue can always be transcoded to/from itself, and any value which could be transcoded to/from a type T can also be transcoded to/from Lazy<T>.


fun tomlMapper(baseMapper: TomlMapper, configuration: TomlMapperConfigurator.() -> Unit): TomlMapper

Creates a mapper which inherits all its configuration from the given baseMapper.

Note that custom encoders/decoders always take precedence over mappings. If your mapper inherits from a mapper which contains a custom decoder for some type T, this decoder will not be overridden by subsequent calls to TomlMapperConfigurator.mapping, unless the decoder's TomlMapper subtype is something other than TomlValue.Map.