Module dotfiles_core::yaml_util
source · Expand description
Module that defines helper functions to process YAML configuration sources.
Functions§
- Process each element of the hash with the
process_function
and then fold them all using into a single result usingfold_function
, for an initial value ofinit
. Returns the first error that happens in either processing or folding. - Gets a specific boolean setting from a yaml hash
- Gets a boolean value for the setting named
name
. - Gets a Boolean value from YAML or context.
- Gets a specific integer setting from a yaml hash
- Gets a Int value for the setting named
name
. - Gets a Integer value from YAML or context.
- Gets a specific string array setting from a yaml hash, but if it is not found it returns an empty array.
- Gets a String value for the setting named
name
. - Gets a specific setting from a yaml hash
- Gets a specific string array setting from a yaml hash
- Gets the content of this YAML node or the value for a specific key in it.
- Gets a specific string setting from a yaml hash
- Gets a String value for the setting named
name
. - Gets a String value from YAML or context.
- Calls a processing function on all elements of an array, will fail if any of the elements fail to process.
- Parse a yaml element as an array.
- Parse a yaml element as boolean.
- Parse a yaml element as Integer.
- Parse a yaml element as string, will convert booleans and integers to string if necessary.
- Gets a native
Vec<String>
from a StrictYaml::Array. It errors out if the passed yaml is not an array or if not all the items in the array are plain StrictYaml Strings - Gets the value for a specified key in a yaml hash and does something with it.
- Executes the
process_function
on each of the items in theyaml_hash
. The yaml hash is assumed to be string keyed. It stops execution if any of the process functions returns an Error, and returns said error. - Reads a StrictYaml File. Returns Error in case of a syntax error.