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§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).
Source§type Error = CachekitError
type Error = CachekitError
Auto Trait Implementations§
impl Freeze for InteropValue
impl RefUnwindSafe for InteropValue
impl Send for InteropValue
impl Sync for InteropValue
impl Unpin for InteropValue
impl UnsafeUnpin for InteropValue
impl UnwindSafe for InteropValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more