pub enum InteropValue {
Null,
Bool(bool),
Int(i128),
Float(f64),
Str(String),
Bytes(Vec<u8>),
Array(Vec<InteropValue>),
Map(BTreeMap<String, InteropValue>),
Set(Vec<InteropValue>),
DateTime {
unix_micros: i64,
},
Uuid(Uuid),
}Expand description
A value in the closed interop/v1 argument data model.
Anything outside this model is unrepresentable by construction; values that
are representable but out of spec range (non-finite floats, integers outside
[-2^63, 2^64-1]) are rejected with an error at encode time — never
silently coerced.
Variants§
Null
msgpack nil.
Bool(bool)
msgpack bool.
Int(i128)
Integer. Must be within [-2^63, 2^64-1] (checked at encode time);
i128 storage lets a single variant span the full signed+unsigned range.
Float(f64)
Float. Must be finite (NaN / ±Inf rejected at encode time). In the
argument profile, integral floats within [-2^63, 2^64) collapse to the
integer encoding, so 2.0 and 2 hash identically (spec: number
canonicalization).
Str(String)
UTF-8 string, encoded as the msgpack str family. No Unicode normalization is applied. Rust strings are well-formed Unicode scalar sequences by construction, which the spec requires.
Bytes(Vec<u8>)
Byte string, encoded as the msgpack bin family (never str).
Array(Vec<InteropValue>)
Ordered sequence; elements normalized recursively.
Map(BTreeMap<String, InteropValue>)
String-keyed map. BTreeMap’s byte-wise key order is the spec’s
Unicode-code-point order (UTF-8 byte order ≡ code point order), applied
at every nesting level.
Set(Vec<InteropValue>)
Set: elements are normalized, encoded, sorted by their encoded bytes (unsigned lexicographic), and deduplicated post-normalization.
DateTime
Timezone-aware instant as microseconds since the Unix epoch.
Sub-microsecond precision must be floored toward negative infinity before construction. Encoding performs the spec’s single IEEE 754 float64 division by 10^6, so hashes are bit-deterministic across SDKs. Naive (offset-less) datetimes are unrepresentable in this API.
Uuid(Uuid)
UUID, encoded as its lowercase hyphenated string form.
Implementations§
Trait Implementations§
Source§impl Clone for InteropValue
impl Clone for InteropValue
Source§fn clone(&self) -> InteropValue
fn clone(&self) -> InteropValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InteropValue
impl Debug for InteropValue
Source§impl From<&str> for InteropValue
impl From<&str> for InteropValue
Source§impl From<BTreeMap<String, InteropValue>> for InteropValue
impl From<BTreeMap<String, InteropValue>> for InteropValue
Source§impl From<String> for InteropValue
impl From<String> for InteropValue
Source§impl From<Uuid> for InteropValue
impl From<Uuid> for InteropValue
Source§impl From<Vec<InteropValue>> for InteropValue
impl From<Vec<InteropValue>> for InteropValue
Source§fn from(v: Vec<InteropValue>) -> Self
fn from(v: Vec<InteropValue>) -> Self
Source§impl From<bool> for InteropValue
impl From<bool> for InteropValue
Source§impl From<f64> for InteropValue
impl From<f64> for InteropValue
Source§impl From<i32> for InteropValue
impl From<i32> for InteropValue
Source§impl From<i64> for InteropValue
impl From<i64> for InteropValue
Source§impl From<i128> for InteropValue
impl From<i128> for InteropValue
Source§impl From<u32> for InteropValue
impl From<u32> for InteropValue
Source§impl From<u64> for InteropValue
impl From<u64> for InteropValue
Source§impl PartialEq for InteropValue
impl PartialEq for InteropValue
impl StructuralPartialEq for InteropValue
Source§impl TryFrom<SystemTime> for InteropValue
impl TryFrom<SystemTime> for InteropValue
Source§fn try_from(t: SystemTime) -> Result<Self, CachekitError>
fn try_from(t: SystemTime) -> Result<Self, CachekitError>
Convert an instant to interop datetime micros, flooring sub-microsecond precision toward negative infinity (spec rule — truncation toward zero would differ for pre-epoch instants).