pub enum JSONValue {
Show 14 variants
JSONObject {
key_value_pairs: Vec<JSONKeyValuePair>,
context: Option<JSONObjectContext>,
},
JSONArray {
values: Vec<JSONArrayValue>,
context: Option<JSONArrayContext>,
},
Integer(String),
Float(String),
Exponent(String),
Null,
Infinity,
NaN,
Hexadecimal(String),
Bool(bool),
DoubleQuotedString(String),
SingleQuotedString(String),
Unary {
operator: UnaryOperator,
value: Box<JSONValue>,
},
Identifier(String),
}
Expand description
Represents a JSON5 value
Where these enum members have String
s, they represent the object as it was tokenized without any modifications (that
is, for example, without any escape sequences un-escaped). The single- and double-quoted String
s do not include the surrounding
quote characters. The JSONValue::JSONObject
Variants§
JSONObject
Represents a JSON5 Object
Fields
key_value_pairs: Vec<JSONKeyValuePair>
The key-value pairs of the object
context: Option<JSONObjectContext>
JSONArray
Represents a JSON5 Array.
Integer(String)
Represents an Integer value. The String value is a literal, as it might appear in JSON5 source
Float(String)
Represents a float value (not including NaN or Infinity, use JSONValue::NaN or JSONValue::Infinity) The String value is a literal as it might appear in JSON5 source
Exponent(String)
Represents an exponent value The String value is a literal as it might appear in JSON5 source
Null
Infinity
NaN
Hexadecimal(String)
Represents a hexadecimal value
The String value is a literal as it might appear in JSON5 source e.g. String::from("0xDEADBEEF")
Bool(bool)
DoubleQuotedString(String)
Double-quoted string, as it appears in source. The String value does not include surrounding quotes
SingleQuotedString(String)
Single-quoted string, as it appears in source. The String value does not include surrounding quotes
Unary
Represents a unary production
Identifier(String)
Represents unquoted identifiers.
Uniquely, a JSONValue::Identifier can only be used in dictionary keys.