Function kankyo::unload_from_reader [] [src]

pub fn unload_from_reader<R: Read>(reader: &mut R) -> Result<()>

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.

Examples

Unload from a file at the path ./.env:

use std::fs::File;

kankyo::unload_from_reader(&mut File::open("./.env")?)?;
println!("Successfully unloaded from `./.env`");

Errors

Returns Error::Io if there is an error reading from the reader.