pub struct Json { /* private fields */ }Expand description
Json data type for the DBMS.
It contains a JSON object represented using serde_json::Value.
A default instance of Json is null.
§Ordering
Json values are ordered using a type-based hierarchical ordering scheme:
- Type precedence:
Null < Bool < Number < String < Array < Object - Within same type:
- Null: all equal
- Bool:
false < true - Number: exact numeric comparison of the mathematical values, without
lossy conversion between integers and floats; when an integer and a
float have the same value (e.g.
1and1.0) the integer sorts first - String: lexicographic comparison
- Array: element-wise lexicographic comparison
- Object: keys sorted alphabetically, then key-value pairs compared lexicographically
This ordering is deterministic and suitable for indexing and sorting operations, though comparing values of different types may not be semantically meaningful.
§Equality and hashing
Equality and hashing are derived from the same ordering, so two values are
equal exactly when they compare Ordering::Equal and equal values always
hash identically. In particular 1 and 1.0 are distinct values (matching
serde_json::Value equality), while 0.0 and -0.0 are equal.
Implementations§
Trait Implementations§
impl DataType for Json
Source§impl<'de> Deserialize<'de> for Json
impl<'de> Deserialize<'de> for Json
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encode for Json
impl Encode for Json
impl Eq for Json
Source§impl Ord for Json
impl Ord for Json
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Auto Trait Implementations§
impl Freeze for Json
impl RefUnwindSafe for Json
impl Send for Json
impl Sync for Json
impl Unpin for Json
impl UnsafeUnpin for Json
impl UnwindSafe for Json
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