We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppose I have this config struct
#[derive(Debug, Deserialize)] struct MyConfig { // ... } impl Default for MyConfig { fn default() -> MyConfig { // some complex logic } }
I want to produce a MyConfig, where values explicitly set in config.toml are used, otherwise, the default implementation is used.
MyConfig
config.toml
Something like
Config::builder(). .add_source(File::with_name("config.toml")) .set_default(???, MyConfig::default()) .build()?;
But I couldn't figure out a way to do this. This seems like a very common use case, so I feel like I'm missing something.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Suppose I have this config struct
I want to produce a
MyConfig
, where values explicitly set inconfig.toml
are used, otherwise, the default implementation is used.Something like
But I couldn't figure out a way to do this. This seems like a very common use case, so I feel like I'm missing something.
The text was updated successfully, but these errors were encountered: