Expand description
KEY=value env file parse / write helpers.
§Examples
use horto_os_ui_shared::kits::envfile;
let map = envfile::parse("FOO=bar\n# c\nBAZ=\"x y\"\n");
assert_eq!(map.get("FOO").map(String::as_str), Some("bar"));
assert_eq!(map.get("BAZ").map(String::as_str), Some("x y"));Functions§
- escape_
double 🔒 - load
- Load KEY=VALUE pairs from
pathinto a map. - normalize_
wifi_ iface - Normalize optional
WiFiiface: disabled answers becomenone. - parse
- Parse KEY=value / KEY=“value” lines into an ordered map.
- require_
keys - Ensure each of
keysis present and non-empty inmap. - set_key
- Insert or replace
keyinmap. - unquote 🔒
- wifi_
ap_ enabled - True when
WIFI_INTERFACEnames a realWiFiAP iface (notnone/ empty /n). - wifi_
iface_ enabled - True when the
WiFiinterface value should drive hostapd / SSID prompts. - write
- Write KEY=“value” lines.