[−][src]Function kankyo::unload_from_reader
pub fn unload_from_reader<R: Read>(reader: &mut R) -> IoResult<()>
Unloads from the read content of the given reader.
The reader should contain content that of a .env
file.
If you need to unload a given slice of keys, prefer utils::unload
. If
you need to just unload from a .env
file, prefer unload
.
Examples
Unload from a file at the path ./.env
:
use std::fs::File; let mut file = try!(File::open("./.env")); try!(kankyo::unload_from_reader(&mut file)); println!("Successfully unloaded from `./.env`");
Errors
Returns an std::io::Error
if there is an error reading from the reader.