#iron-framework #file-reader #web-framework #filename #toml #settings #name

iron_config

This is a config file reader for Iron framework(an web framework writen in Rust).You can put all you settings in a file which names Iron.toml

2 releases

Uses old Rust 2015

0.1.1 Aug 27, 2017
0.1.0 Feb 12, 2017

#14 in #iron-framework

Apache-2.0/MIT

5KB
85 lines

iron_config

This is a config file reader for Iron framework(an web framework writen in Rust).

You can put all you settings in a file which names Iron.toml.

It will search Iron.toml by this order:

1, The value of IRON_CONFIG_FILE in environment variable.

2, ./Iron.toml

3, ./site/Iron.toml

Usage:

In you Cargo.toml:

    [dependencies]
    iron_config = "0.1.0"
    lazy_static = "*"

In you crate:

    extern crate iron_config;
    use iron_config::IC;
    #[macro_use]
    extern crate lazy_static;
    lazy_static!{
       static ref DOMAIN: &'static str = IC.lookup("MAIN.DOMAIN").unwrap().as_str().unwrap();
     }

    fn main() {
        println!("{:?}",*DOMAIN); 
    }

License

or

Dependencies

~265–510KB
~11K SLoC