pub fn text_to_key_value_map(
text: &str,
) -> Result<HashMap<Box<str>, Box<str>>, Error>Expand description
Parses a string containing key-value pairs into a hash map.
Each non-empty line of the text should contain a key-value pair separated by whitespace. The first whitespace character on each line separates the key from the value.
§Format Rules
- Keys cannot contain whitespace
- Values can contain any characters (leading/trailing whitespace is trimmed)
- Empty lines and lines without whitespace are ignored
- Keys must be unique (duplicate keys result in an error)
§Errors
Returns Error::MultipleKeys if a duplicate key is found.