pub enum Value {
Null,
Bool(bool),
Number(Number),
String(String),
Datetime(String),
Array(Vec<Value>),
Object(Map),
}Expand description
A parsed document, or any node within one.
Variants§
Null
Bool(bool)
Number(Number)
String(String)
Datetime(String)
An RFC 3339-ish TOML datetime, kept as its source spelling.
Every datetime originates in the TOML parser. It round-trips exactly through
Display/FromStr for all four TOML forms (offset datetime, local
datetime, local date, local time), so a string is enough to carry it
across a merge without pulling toml into this crate. JSON has no
datetime, so it renders as a string on the way out.
Array(Vec<Value>)
Object(Map)
Implementations§
Source§impl Value
impl Value
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
The kind of a value, for conflict reporting and parse errors.
All numbers are one kind: an int layer overriding a float (or the reverse) is a routine thing to write and carries no risk of shadowing a subtree, which is what strict mode exists to catch. Datetimes are their own kind — they are not strings until JSON conversion.