Enum toml_edit::Value
[−]
[src]
pub enum Value { Integer(Formatted<i64>), String(Formatted<String>), Float(Formatted<f64>), DateTime(Formatted<DateTime>), Boolean(Formatted<bool>), Array(Array), InlineTable(InlineTable), }
Representation of a TOML Value (as part of a Key/Value Pair).
Variants
Integer(Formatted<i64>)
A 64-bit integer value.
String(Formatted<String>)
A string value.
Float(Formatted<f64>)
A 64-bit float value.
DateTime(Formatted<DateTime>)
A Date-Time value.
Boolean(Formatted<bool>)
A boolean value.
Array(Array)
An inline array of values.
InlineTable(InlineTable)
An inline table of key/value pairs.
Methods
impl Value
[src]
Downcasting
fn as_integer(&self) -> Option<i64>
[src]
Casts self
to integer.
fn is_integer(&self) -> bool
[src]
Returns true iff self
is an integer.
fn as_float(&self) -> Option<f64>
[src]
Casts self
to float.
fn is_float(&self) -> bool
[src]
Returns true iff self
is a float.
fn as_bool(&self) -> Option<bool>
[src]
Casts self
to boolean.
fn is_bool(&self) -> bool
[src]
Returns true iff self
is a boolean.
fn as_str(&self) -> Option<&str>
[src]
Casts self
to str.
fn is_str(&self) -> bool
[src]
Returns true iff self
is a string.
fn as_date_time(&self) -> Option<&DateTime>
[src]
Casts self
to date-time.
fn is_date_time(&self) -> bool
[src]
Returns true iff self
is a date-time.
fn as_array(&self) -> Option<&Array>
[src]
Casts self
to array.
fn as_array_mut(&mut self) -> Option<&mut Array>
[src]
Casts self
to mutable array.
fn is_array(&self) -> bool
[src]
Returns true iff self
is an array.
fn as_inline_table(&self) -> Option<&InlineTable>
[src]
Casts self
to inline table.
fn as_inline_table_mut(&mut self) -> Option<&mut InlineTable>
[src]
Casts self
to mutable inline table.
fn is_inline_table(&self) -> bool
[src]
Returns true iff self
is an inline table.
Trait Implementations
impl From<i64> for Value
[src]
impl From<f64> for Value
[src]
impl<'b> From<&'b str> for Value
[src]
impl From<String> for Value
[src]
impl From<bool> for Value
[src]
impl From<DateTime> for Value
[src]
impl<V: Into<Value>> FromIterator<V> for Value
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = V>,
[src]
I: IntoIterator<Item = V>,
Creates a value from an iterator. Read more
impl<'k, K: Into<&'k Key>, V: Into<Value>> FromIterator<(K, V)> for Value
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = (K, V)>,
[src]
I: IntoIterator<Item = (K, V)>,
Creates a value from an iterator. Read more
impl Debug for Value
[src]
impl Clone for Value
[src]
fn clone(&self) -> Value
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl FromStr for Value
[src]
type Err = TomlError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Parses a value from a &str