Skip to main content

Module envfile

Module envfile 

Source
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 path into a map.
normalize_wifi_iface
Normalize optional WiFi iface: disabled answers become none.
parse
Parse KEY=value / KEY=“value” lines into an ordered map.
require_keys
Ensure each of keys is present and non-empty in map.
set_key
Insert or replace key in map.
unquote 🔒
wifi_ap_enabled
True when WIFI_INTERFACE names a real WiFi AP iface (not none / empty / n).
wifi_iface_enabled
True when the WiFi interface value should drive hostapd / SSID prompts.
write
Write KEY=“value” lines.