Crate confu[][src]

Expand description

Confu is a no frills Rust application configuration library. It supports getting configuration from environment, command line arguments and defaults.

Specificity: defaults -> environment -> arguments. Arguments being the most specific, will take precedence over the corresponding environment values, or default values, if such were also defined.


use confu::Confu;

#[confu_prefix = "APP_"]
struct Config {
    #[default = "postgres"]
    db_user: String,

    #[default = "postgres"]
    db_password: String,

    #[default = ""]
    api_host: String,

    telemetry: String,

    super_secret_stuff: String,

fn main() {
    let config = Config::confu();;



derived automatically for any non-enum like struct that contain only the named String fields via #[derive(Confu)].

Derive Macros


derives confu::Confu trait methods