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 the IR naming toml. 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.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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