Enum zenv::Line [−][src]
pub enum Line { KeyVal(KeyVal), Empty, }
Expand description
(Can be) Used to parse the current line
Example
use zenv::{Line, KeyVal, Quote}; let line = Line::from("BASIC=basic"); let k = "BASIC".to_string(); let v = "basic".to_string(); assert_eq!(line, Line::KeyVal(KeyVal { k, v, q: Quote::No })); // Commented line let empty = Line::from("# COMMENT=commented"); assert_eq!(empty, Line::Empty); // With quotes let quoted = Line::from("S_QUOTED='single_quoted'"); let k = "S_QUOTED".to_string(); let v = "single_quoted".to_string(); assert_eq!(quoted, Line::KeyVal(KeyVal { k, v, q: Quote::Single }));
Variants
KeyVal(KeyVal)
When the current line is a key=val
pair
When the current line is empty