rpkl
Language bindings to Pkl for Rust.
Requires the pkl binary to be available on your path. You can install pkl for your os using the steps from their docs: https://pkl-lang.org/main/current/pkl-cli/index.html#installation
Usage
ip = "127.0.0.1"
database {
username = "admin"
password = "secret"
}
let config: Config = from_config?;
Evaluator Options
You can pass options to the evaluator, such as properties, by using [from_config_with_options].
username = read("prop:username")
password = read("prop:password")
let options = default
.properties;
let config: Config = from_config_with_options?;
Codegen
Codegen can be enabled by adding the codegen feature.
use ;
You can also generate code using the experimental CLI.
For more info on codegen, see the docs.