Enum toml_edit::easy::value::Value [−][src]
pub enum Value {
Integer(i64),
Float(f64),
Boolean(bool),
Datetime(Datetime),
String(String),
Array(Array),
Table(Table),
}
Expand description
Representation of a TOML value.
Variants
Integer(i64)
Represents a TOML integer
Tuple Fields of Integer
0: i64
Float(f64)
Represents a TOML float
Tuple Fields of Float
0: f64
Boolean(bool)
Represents a TOML boolean
Tuple Fields of Boolean
0: bool
Datetime(Datetime)
Represents a TOML datetime
Tuple Fields of Datetime
0: Datetime
String(String)
Represents a TOML string
Tuple Fields of String
0: String
Array(Array)
Represents a TOML array
Tuple Fields of Array
0: Array
Table(Table)
Represents a TOML table
Tuple Fields of Table
0: Table
Implementations
Convert a T
into toml::Value
which is an enum that can represent
any valid TOML data.
This conversion can fail if T
’s implementation of Serialize
decides to
fail, or if T
contains a map with non-string keys.
Interpret a toml::Value
as an instance of type T
.
This conversion can fail if the structure of the Value
does not match the
structure expected by T
, for example if T
is a struct type but the
Value
contains something other than a TOML table. It can also fail if the
structure is correct but T
’s implementation of Deserialize
decides that
something is wrong with the data, for example required struct fields are
missing from the TOML map or some number is too big to fit in the expected
primitive type.
Index into a TOML array or map. A string index can be used to access a value in a map, and a usize index can be used to access an element of an array.
Returns None
if the type of self
does not match the type of the
index, for example if the index is a string and self
is an array or a
number. Also returns None
if the given key does not exist in the map
or the given index is not within the bounds of the array.
Mutably index into a TOML array or map. A string index can be used to access a value in a map, and a usize index can be used to access an element of an array.
Returns None
if the type of self
does not match the type of the
index, for example if the index is a string and self
is an array or a
number. Also returns None
if the given key does not exist in the map
or the given index is not within the bounds of the array.
Extracts the integer value if it is an integer.
Tests whether this value is an integer.
Extracts the datetime value if it is a datetime.
Note that a parsed TOML value will only contain ISO 8601 dates. An example date is:
1979-05-27T07:32:00Z
Tests whether this value is a datetime.
Extracts the array value if it is an array.
Extracts the table value if it is a table.
Tests whether this and another value have the same type.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Value
impl UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more