pub enum Yaml {
Real(String),
Integer(i64),
String(String),
Boolean(bool),
Array(Vec<Yaml>),
Hash(LinkedHashMap<Yaml, Yaml>),
Alias(usize),
Tagged(String, Box<Yaml>),
Null,
BadValue,
}Expand description
The YAML node representation, mirroring the original design:
Realis an f64 stored as string (lazy parse).Integeris i64.Stringis an owned string.Booleanis bool.Arrayis a vector ofYaml.Hashis an insertion-order map (usinglinked_hash_maplogic).Aliasfor referencing an anchor.Nullrepresents explicit YAML null.BadValueis returned for invalid indexing or out-of-range lookups.
Variants§
Real(String)
Integer(i64)
String(String)
Boolean(bool)
Array(Vec<Yaml>)
Hash(LinkedHashMap<Yaml, Yaml>)
Alias(usize)
Tagged(String, Box<Yaml>)
Null
BadValue
Implementations§
Source§impl Yaml
Accessors for Yaml
impl Yaml
Accessors for Yaml
pub const fn as_bool(&self) -> Option<bool>
pub const fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
pub fn as_str(&self) -> Option<&str>
pub fn as_vec(&self) -> Option<&[Self]>
pub const fn as_hash(&self) -> Option<&LinkedHashMap<Self, Self>>
pub const fn is_null(&self) -> bool
pub const fn is_badvalue(&self) -> bool
Trait Implementations§
Source§impl Ord for Yaml
impl Ord for Yaml
Source§impl PartialOrd for Yaml
impl PartialOrd for Yaml
impl Eq for Yaml
impl StructuralPartialEq for Yaml
Auto Trait Implementations§
impl Freeze for Yaml
impl RefUnwindSafe for Yaml
impl Send for Yaml
impl Sync for Yaml
impl Unpin for Yaml
impl UnwindSafe for Yaml
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more