Enum zenv::Line [−][src]
pub enum Line<'l> {
KeyVal(KeyVal<'l>),
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";
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";
let v = "single_quoted".to_string();
assert_eq!(quoted, Line::KeyVal(KeyVal { k, v, q: Quote::Single }));
Variants
KeyVal(KeyVal<'l>)
Tuple Fields
0: KeyVal<'l>
When the current line is a key=val
pair
Empty
When the current line is empty