pub struct CompatibilityValueV2 { /* private fields */ }Expand description
One exact V2 compatibility scalar.
Ordinary values retain the released CanonicalValue wire. V1-only
strings and non-canonical temporal, duration, or decimal spellings use
deterministic bounded UTF-8 chunks so no individual JSON string exceeds
the canonical codec ceiling.
Implementations§
Source§impl CompatibilityValueV2
impl CompatibilityValueV2
Sourcepub const fn canonical(value: CanonicalValue) -> Self
pub const fn canonical(value: CanonicalValue) -> Self
Wrap one ordinary canonical scalar without changing its wire shape.
Sourcepub fn released_string(value: impl Into<String>) -> Result<Self, Diagnostic>
pub fn released_string(value: impl Into<String>) -> Result<Self, Diagnostic>
Preserve one released string above the canonical per-string ceiling.
Sourcepub fn released_datetime(value: impl Into<String>) -> Result<Self, Diagnostic>
pub fn released_datetime(value: impl Into<String>) -> Result<Self, Diagnostic>
Preserve one released timezone-free datetime spelling exactly.
Sourcepub fn released_datetime_tz(
value: impl Into<String>,
) -> Result<Self, Diagnostic>
pub fn released_datetime_tz( value: impl Into<String>, ) -> Result<Self, Diagnostic>
Preserve one released timezone-aware datetime spelling exactly.
Sourcepub fn released_duration(value: impl Into<String>) -> Result<Self, Diagnostic>
pub fn released_duration(value: impl Into<String>) -> Result<Self, Diagnostic>
Preserve one released duration spelling exactly.
Sourcepub fn released_decimal(value: impl Into<String>) -> Result<Self, Diagnostic>
pub fn released_decimal(value: impl Into<String>) -> Result<Self, Diagnostic>
Preserve one released non-canonical decimal spelling exactly.
Sourcepub const fn value_type(&self) -> ValueTypeTag
pub const fn value_type(&self) -> ValueTypeTag
Return the scalar domain claimed by this literal.
Sourcepub const fn canonical_value(&self) -> Option<&CanonicalValue>
pub const fn canonical_value(&self) -> Option<&CanonicalValue>
Return the ordinary canonical value, when this is not a V1-only spelling.
Sourcepub const fn released_kind(&self) -> Option<ReleasedValueKindV2>
pub const fn released_kind(&self) -> Option<ReleasedValueKindV2>
Return the released-only lexical domain, when present.
Sourcepub fn released_chunks(&self) -> Option<&[String]>
pub fn released_chunks(&self) -> Option<&[String]>
Return canonical bounded chunks for a released-only spelling.
Sourcepub fn released_text(&self) -> Option<String>
pub fn released_text(&self) -> Option<String>
Reconstruct the exact released spelling.
Sourcepub fn semantic_cmp_same_domain(&self, other: &Self) -> Option<Ordering>
pub fn semantic_cmp_same_domain(&self, other: &Self) -> Option<Ordering>
Compare two same-domain values with the released V1 result semantics.
Representation Ord remains the deterministic wire identity order.
This method is for compatibility ordering and duplicate detection.
Trait Implementations§
Source§impl Clone for CompatibilityValueV2
impl Clone for CompatibilityValueV2
Source§fn clone(&self) -> CompatibilityValueV2
fn clone(&self) -> CompatibilityValueV2
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more