Expand description
Module that defines helper functions to process YAML configuration sources.
Functionsยง
- fold_
hash_ until_ first_ err - 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. - get_
boolean_ from_ yaml_ hash - Gets a specific boolean setting from a yaml hash
- get_
boolean_ setting_ from_ context - Gets a boolean value for the setting named
name
. - get_
boolean_ setting_ from_ yaml_ or_ context - Gets a Boolean value from YAML or context.
- get_
integer_ from_ yaml_ hash - Gets a specific integer setting from a yaml hash
- get_
integer_ setting - Gets a Int value for the setting named
name
. - get_
integer_ setting_ from_ yaml_ or_ context - Gets a Integer value from YAML or context.
- get_
optional_ string_ array_ from_ yaml_ hash - Gets a specific string array setting from a yaml hash, but if it is not found it returns an empty array.
- get_
setting_ from_ context - Gets a String value for the setting named
name
. - get_
setting_ from_ yaml_ hash - Gets a specific setting from a yaml hash
- get_
string_ array_ from_ yaml_ hash - Gets a specific string array setting from a yaml hash
- get_
string_ content_ or_ keyed_ value - Gets the content of this YAML node or the value for a specific key in it.
- get_
string_ from_ yaml_ hash - Gets a specific string setting from a yaml hash
- get_
string_ setting - Gets a String value for the setting named
name
. - get_
string_ setting_ from_ yaml_ or_ context - Gets a String value from YAML or context.
- map_
yaml_ array - Calls a processing function on all elements of an array, will fail if any of the elements fail to process.
- parse_
as_ array - Parse a yaml element as an array.
- parse_
as_ boolean - Parse a yaml element as boolean.
- parse_
as_ integer - Parse a yaml element as Integer.
- parse_
as_ string - Parse a yaml element as string, will convert booleans and integers to string if necessary.
- parse_
as_ string_ array - 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 - process_
value_ from_ yaml_ hash - Gets the value for a specified key in a yaml hash and does something with it.
- process_
yaml_ hash_ until_ first_ err - 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. - read_
yaml_ file - Reads a StrictYaml File. Returns Error in case of a syntax error.