[−][src]Function confy::store
pub fn store<T: Serialize>(name: &str, cfg: T) -> Result<(), ConfyError>
Save changes made to a configuration object
This function will update a configuration, with the provided values, and create a new one, if none exists.
You can also use this function to create a new configuration
with different initial values than which are provided
by your Default
trait implementation, or if your
configuration structure can't implement Default
.
let my_cfg = MyConf {}; confy::store("my-app-name", my_cfg)?;
Errors returned are I/O errors related to not being
able to write the configuration file or if confy
encounters an operating system or environment it does
not support.