pub enum YamlValue {
String(String),
Integer(i64),
Float(f64),
Boolean(bool),
Null,
Array(YamlArray),
Object(YamlObject),
}Expand description
YAML value representation.
This represents the pure value of a YAML element without any source code location information.
Variants§
String(String)
String value.
Integer(i64)
Integer value.
Float(f64)
Floating-point value.
Boolean(bool)
Boolean value.
Null
Null value.
Array(YamlArray)
Array value.
Object(YamlObject)
Object value.
Implementations§
Source§impl YamlValue
impl YamlValue
Sourcepub fn as_integer(&self) -> Option<i64>
pub fn as_integer(&self) -> Option<i64>
Returns the integer value if the value is an integer.
Sourcepub fn as_float(&self) -> Option<f64>
pub fn as_float(&self) -> Option<f64>
Returns the floating-point value if the value is a float.
Sourcepub fn as_array(&self) -> Option<&Vec<YamlValue>>
pub fn as_array(&self) -> Option<&Vec<YamlValue>>
Returns a reference to the array if the value is an array.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for YamlValue
impl<'de> Deserialize<'de> for YamlValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for YamlValue
Auto Trait Implementations§
impl Freeze for YamlValue
impl RefUnwindSafe for YamlValue
impl Send for YamlValue
impl Sync for YamlValue
impl Unpin for YamlValue
impl UnsafeUnpin for YamlValue
impl UnwindSafe for YamlValue
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