pub enum KdlValue {
String(String),
Integer(i128),
Float(f64),
Bool(bool),
Null,
}Expand description
A specific KDL Value.
Variants§
String(String)
A KDL String.
Integer(i128)
A non-float KDL Number
Float(f64)
A floating point KDL Number
Bool(bool)
A KDL Boolean.
Null
The KDL Null Value.
Implementations§
Source§impl KdlValue
impl KdlValue
Sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Returns true if the value is a KdlValue::String.
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if the value is a KdlValue::Integer.
Sourcepub fn is_float(&self) -> bool
pub fn is_float(&self) -> bool
Returns true if the value is a KdlValue::Float.
Sourcepub fn is_bool(&self) -> bool
pub fn is_bool(&self) -> bool
Returns true if the value is a KdlValue::Bool.
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Returns true if the value is a KdlValue::Null.
Sourcepub fn as_string(&self) -> Option<&str>
pub fn as_string(&self) -> Option<&str>
Returns Some(&str) if the KdlValue is a KdlValue::String,
otherwise returns None.
Sourcepub fn as_integer(&self) -> Option<i128>
pub fn as_integer(&self) -> Option<i128>
Returns Some(i128) if the KdlValue is a KdlValue::Integer,
otherwise returns None.
Sourcepub fn as_float(&self) -> Option<f64>
pub fn as_float(&self) -> Option<f64>
Returns Some(f64) if the KdlValue is a KdlValue::Float,
otherwise returns None.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns Some(bool) if the KdlValue is a KdlValue::Bool, otherwise returns None.
Trait Implementations§
Source§impl PartialOrd for KdlValue
impl PartialOrd for KdlValue
impl Eq for KdlValue
Auto Trait Implementations§
impl Freeze for KdlValue
impl RefUnwindSafe for KdlValue
impl Send for KdlValue
impl Sync for KdlValue
impl Unpin for KdlValue
impl UnwindSafe for KdlValue
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