Explicon
Explicon is a tiny utility crate for removing surprises from configuration.
Have you ever been annoyed that when you set some value in your config.toml
if silently got overriden by some environment variable you weren't even aware of?
This crate addresses exactly that problem, by making configuration EXPLICIT.
Example
// Hypothetical other config crate (pseudo-code)
let config = from_file
.from_env // Silently overrides values in config.toml, BAD!
In contrast:
// Explicon
use Sourced;
let config: MyAwesomeConfig = from_str.unwrap;
let host: String = config.host.resolve.unwrap // Get actual value from config
let port: u16 = config.port.resolve.unwrap_or
As you can see, using explicon::Sourced
in your configuration
allows you to see exactly where values come from only from your
config.toml
file, no need to parse actual source of your program
to figure out that your host is actually overriden by some MY_COOL_APP_HOST
.
No hidden flow.