Function dotfiles_core::yaml_util::get_setting_from_yaml_hash
source · pub fn get_setting_from_yaml_hash(
name: &str,
setting_type: &Setting,
yaml: &StrictYaml
) -> Result<Setting, DotfilesError>
Expand description
Gets a specific setting from a yaml hash
§Errors
- ErrorType::UnexpectedYamlTypeError if the yaml is not a hash.
- ErrorType::UnexpectedYamlTypeError if the yaml does not have string keys.
- ErrorType::UnexpectedYamlTypeError if the value’s type does not match the
setting_type
. - ErrorType::IncompleteConfigurationError if the hash does not contain the requested key