Last active
October 23, 2018 17:19
-
-
Save softprops/df8a247746f7cc84c3f9e03ea207bd8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate envy_store; | |
#[macro_use] | |
extern crate serde_derive; | |
extern crate tokio; | |
use tokio::runtime::Runtime; | |
// parameter names map to field names | |
#[derive(Deserialize, Debug)] | |
struct Config { | |
foo: String, | |
bar: Vec<String>, | |
zar: u32, | |
} | |
fn main() { | |
let mut rt = Runtime::new().expect( | |
"failed to initialize runtime" | |
); | |
let conf = envy_store::from_path::<Config, _>("/demo"); | |
println!("config {:#?}", rt.block_on(conf)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment