Function dotfiles_core::yaml_util::process_value_from_yaml_hash
source · pub fn process_value_from_yaml_hash<T, F>(
key: &str,
yaml_hash: &StrictYaml,
process: F
) -> Result<T, DotfilesError>
Expand description
Gets the value for a specified key in a yaml hash and does something with it.
Returns the result of the process function being applied to the value in question.
§Errors
- Will return an error that happens during the process_function application.
- Will return a ErrorType::UnexpectedYamlTypeError if the value is not a hash or if the hash doesn’t have string-based keys.
- Will return a ErrorType::IncompleteConfigurationError if the key is not found in the hash.