pub enum Value<'a> {
Null,
Bool(bool),
String(Cow<'a, str>),
Number(Number),
Binary(&'a [u8]),
Date(Date),
Timestamp(Timestamp),
TimestampTz(TimestampTz),
Interval(Interval),
Array(Vec<Self>),
Object(Object<'a>),
}Expand description
Represents a JSON or extended JSON value.
This enum supports both standard JSON types (Null, Bool, String, Number, Array, Object) and extended types for specialized data representation (Binary, Date, Timestamp, etc.). The extended types provide additional functionality beyond the JSON specification, making this implementation more suitable for database applications and other systems requiring richer data type support.
Variants§
Null
Represents a JSON null value
Bool(bool)
Represents a JSON boolean value (true or false)
String(Cow<'a, str>)
Represents a JSON string value
Number(Number)
Represents a JSON number value with various internal representations
Binary(&'a [u8])
Extended type: Represents binary data not supported in standard JSON Useful for storing raw bytes, images, or other binary content
Date(Date)
Extended type: Represents a calendar date (year, month, day) Stored as days since epoch for efficient comparison and manipulation
Timestamp(Timestamp)
Extended type: Represents a timestamp without timezone information Stored as microseconds since epoch
TimestampTz(TimestampTz)
Extended type: Represents a timestamp with timezone information Includes both timestamp and timezone offset
Interval(Interval)
Extended type: Represents a time interval or duration Useful for time difference calculations and scheduling
Array(Vec<Self>)
Represents a JSON array of values
Object(Object<'a>)
Represents a JSON object as key-value pairs