Enum yaml_rust::yaml::Yaml
[-] [+]
[src]
pub enum Yaml { Real(String), Integer(i64), String(String), Boolean(bool), Array(Array), Hash(Hash), Alias(usize), Null, BadValue, }
An YAML node is store as this Yaml
enumeration, it provides an easy way to
access your YAML document.
Examples
use yaml_rust::Yaml; let foo = Yaml::from_str("-123"); // convert the string to the appropriate YAML type assert_eq!(foo.as_i64().unwrap(), -123); // iterator over an Array let vec = Yaml::Array(vec![Yaml::Integer(1), Yaml::Integer(2)]); for v in vec.as_vec().unwrap() { assert!(v.as_i64().is_some()); }