You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to handle multiple configurations with the same fields.
I have the default settings and N configuration files. I want to merge the default settings with each file separately and as a result, get N structures with the settings.
How to reset values or parse them using only one source?
letmut config = Config::new();
config
.set_default("host","localhost")?
.set_default("port",21)?
.set_default("user_id",0)?;
config.merge(File::with_name("foo"))?;let host_foo:Host = config.try_into()?;
config.reset();// <-- reset to default
config.merge(File::with_name("bar"))?;// merge only with default valueslet host_bar:Host = config.try_into()?;
The text was updated successfully, but these errors were encountered:
I want to handle multiple configurations with the same fields.
I have the default settings and N configuration files. I want to merge the default settings with each file separately and as a result, get N structures with the settings.
How to reset values or parse them using only one source?
The text was updated successfully, but these errors were encountered: