pub struct Env;Expand description
Parser for the env format: dotenv / env-file KEY=VALUE lines into a flat string map.
Skips blank lines and # comments, supports quoted values, and records each key’s line number
as a Location. The result is always a map of strings. Stateless — construct with
Env::new.
use tanzim_parse::{Parse, env::Env};
let value = Env::new().parse("file", ".env", b"# comment\nPORT=8080\n").unwrap();
let port = value.value.as_map().unwrap().get("PORT").unwrap();
assert_eq!(port.value.as_string().unwrap(), "8080");Implementations§
Trait Implementations§
impl Copy for Env
Auto Trait Implementations§
impl Freeze for Env
impl RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnsafeUnpin for Env
impl UnwindSafe for Env
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more