parse_attributes

Function parse_attributes 

Source
pub fn parse_attributes(
    keys: &[&str],
    attrs: Option<&HashMap<&str, &str>>,
) -> Result<HashMap<String, String>>
Expand description

Parse an optional key-value &str map for allowed keys, returning a map of owned strings.

If a key is prefixed with a *, it is required to have a boolean value, and the * is stripped from the key name when parsing and returning the map.

Returns an Invalid error if not all keys are allowed, or if one of the keys marked as boolean has a value other than true or false.