pub enum CanonicalValue {
String(CanonicalString),
Long(i64),
Double(CanonicalDouble),
Boolean(bool),
Date(CanonicalDate),
DateTime(CanonicalDateTime),
DateTimeTz(CanonicalDateTimeTz),
Decimal(DecimalValue),
Duration(CanonicalDuration),
}Expand description
A canonical scalar value with an explicit domain tag.
Variants§
String(CanonicalString)
UTF-8 text.
Long(i64)
Signed 64-bit integer; JSON uses a decimal string.
Double(CanonicalDouble)
Finite binary64; JSON uses fixed-width IEEE bits.
Boolean(bool)
Boolean.
Date(CanonicalDate)
Date.
DateTime(CanonicalDateTime)
Timezone-free date-time.
DateTimeTz(CanonicalDateTimeTz)
Timezone-aware date-time.
Decimal(DecimalValue)
Decimal.
Duration(CanonicalDuration)
Duration.
Implementations§
Source§impl CanonicalValue
impl CanonicalValue
Sourcepub const fn value_type(&self) -> ValueTypeTag
pub const fn value_type(&self) -> ValueTypeTag
Return the closed scalar-domain tag.
Sourcepub fn semantic_cmp_same_domain(&self, other: &Self) -> Option<Ordering>
pub fn semantic_cmp_same_domain(&self, other: &Self) -> Option<Ordering>
Compare values within one scalar domain by provider semantics.
This is deliberately separate from representation Ord, which remains
the deterministic identity order used by canonical sets and bytes.
Compare values only when both belong to the same semantic scalar domain.
Returns None for different domains or a domain without semantic ordering.
Trait Implementations§
Source§impl Clone for CanonicalValue
impl Clone for CanonicalValue
Source§fn clone(&self) -> CanonicalValue
fn clone(&self) -> CanonicalValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CanonicalValue
impl Debug for CanonicalValue
Source§impl<'de> Deserialize<'de> for CanonicalValue
impl<'de> Deserialize<'de> for CanonicalValue
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
impl Eq for CanonicalValue
Source§impl From<CanonicalValue> for CompatibilityValueV2
impl From<CanonicalValue> for CompatibilityValueV2
Source§fn from(value: CanonicalValue) -> Self
fn from(value: CanonicalValue) -> Self
Converts to this type from the input type.
Source§impl Hash for CanonicalValue
impl Hash for CanonicalValue
Source§impl Ord for CanonicalValue
impl Ord for CanonicalValue
Source§fn cmp(&self, other: &CanonicalValue) -> Ordering
fn cmp(&self, other: &CanonicalValue) -> Ordering
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
Source§impl PartialEq for CanonicalValue
impl PartialEq for CanonicalValue
Source§impl PartialOrd for CanonicalValue
impl PartialOrd for CanonicalValue
Source§impl Serialize for CanonicalValue
impl Serialize for CanonicalValue
impl StructuralPartialEq for CanonicalValue
Auto Trait Implementations§
impl Freeze for CanonicalValue
impl RefUnwindSafe for CanonicalValue
impl Send for CanonicalValue
impl Sync for CanonicalValue
impl Unpin for CanonicalValue
impl UnsafeUnpin for CanonicalValue
impl UnwindSafe for CanonicalValue
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