Skip to content

Instantly share code, notes, and snippets.

@softprops
Last active October 23, 2018 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save softprops/df8a247746f7cc84c3f9e03ea207bd8e to your computer and use it in GitHub Desktop.
Save softprops/df8a247746f7cc84c3f9e03ea207bd8e to your computer and use it in GitHub Desktop.
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