3 unstable releases
Uses old Rust 2015
0.2.1 | Feb 15, 2019 |
---|---|
0.2.0 | Dec 2, 2018 |
0.1.0 | Nov 2, 2018 |
#2872 in Parser implementations
3,147 downloads per month
Used in 11 crates
(6 directly)
9KB
151 lines
envfile
Rust crate for parsing environment files into an in-memory map.
extern crate envfile;
use envfile::EnvFile;
use std::io;
use std::path::Path;
fn main() -> io::Result<()> {
let mut envfile = EnvFile::new(&Path::new("examples/test.env"))?;
for (key, value) in &envfile.store {
println!("{}: {}", key, value);
}
envfile.update("ID", "example");
println!("ID: {}", envfile.get("ID").unwrap_or(""));
// envfile.write()?;
Ok(())
}
lib.rs
:
Libary for parsing environment files into an in-memory map.
extern crate envfile;
use envfile::EnvFile;
use std::io;
use std::path::Path;
fn main() -> io::Result<()> {
let mut envfile = EnvFile::new(&Path::new("examples/test.env"))?;
for (key, value) in &envfile.store {
println!("{}: {}", key, value);
}
envfile.update("ID", "example");
println!("ID: {}", envfile.get("ID").unwrap_or(""));
// envfile.write()?;
Ok(())
}
Dependencies
~415KB