Crates.io | iron_config |
lib.rs | iron_config |
version | 0.1.1 |
source | src |
created_at | 2017-02-12 14:34:28.056572 |
updated_at | 2017-08-27 02:59:44.015345 |
description | 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. |
homepage | |
repository | https://github.com/zoumi/iron_config |
max_upload_size | |
id | 8489 |
size | 6,826 |
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.
1, The value of IRON_CONFIG_FILE in environment variable.
2, ./Iron.toml
3, ./site/Iron.toml
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);
}
or