field

fun <T, V> T.field(selector: (T) -> V): ReadOnlyProperty<Any?, V>(source)

Property delegate backed by a specific config instance (not the global registry).

val appConfig: AppConfig = loader.loadAppConfig().getOrThrow()

val dbUrl: String by appConfig.field { it.database.url }
val port: Int by appConfig.field { it.server.port }