Enum toml_span::value::ValueInner
source · pub enum ValueInner<'de> {
String(Cow<'de, str>),
Integer(i64),
Float(f64),
Boolean(bool),
Array(Array<'de>),
Table(Table<'de>),
}
Expand description
The core value types that toml can deserialize to
Note that this library does not support datetime values that are part of the toml spec since I have no need of them, but could be added
Variants§
String(Cow<'de, str>)
A string.
This will be borrowed from the original toml source unless it contains escape characters
Integer(i64)
An integer
Float(f64)
A float
Boolean(bool)
A boolean
Array(Array<'de>)
An array
Table(Table<'de>)
A table
Implementations§
source§impl<'de> ValueInner<'de>
impl<'de> ValueInner<'de>
sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Returns a borrowed string if this is a Self::String
sourcepub fn as_table(&self) -> Option<&Table<'de>>
pub fn as_table(&self) -> Option<&Table<'de>>
Returns a borrowed table if this is a Self::Table
sourcepub fn as_array(&self) -> Option<&Array<'de>>
pub fn as_array(&self) -> Option<&Array<'de>>
Returns a borrowed array if this is a Self::Array
sourcepub fn as_integer(&self) -> Option<i64>
pub fn as_integer(&self) -> Option<i64>
Returns an i64
if this is a Self::Integer
sourcepub fn as_float(&self) -> Option<f64>
pub fn as_float(&self) -> Option<f64>
Returns an f64
if this is a Self::Float
sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns a bool
if this is a Self::Boolean
Trait Implementations§
source§impl<'de> AsRef<ValueInner<'de>> for Value<'de>
impl<'de> AsRef<ValueInner<'de>> for Value<'de>
source§fn as_ref(&self) -> &ValueInner<'de>
fn as_ref(&self) -> &ValueInner<'de>
Converts this type into a shared reference of the (usually inferred) input type.
Auto Trait Implementations§
impl<'de> Freeze for ValueInner<'de>
impl<'de> RefUnwindSafe for ValueInner<'de>
impl<'de> Send for ValueInner<'de>
impl<'de> Sync for ValueInner<'de>
impl<'de> Unpin for ValueInner<'de>
impl<'de> UnwindSafe for ValueInner<'de>
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