A simple library for loading configuration files from disk. All that's
required is a struct with serde::Deserialize
and Default
implemented.
The configuration file is always assumed to be encoded in TOML format.
The library will load the first struct it finds in the following list:
./{name}
./{name}.toml
./.{name}
./.{name}.toml
~/.{name}
~/.{name}.toml
~/.config/{name}
~/.config/{name}.toml
~/.config/{name}/config
~/.config/{name}/config.toml
/etc/.config/{name}
/etc/.config/{name}.toml
/etc/.config/{name}/config
/etc/.config/{name}/config.toml
Usage
extern crate serde_derive;
extern crate loadconf;
/// Sample configuration