pub struct Value<K: Key> { /* private fields */ }Expand description
A JSON value stored in a wide event.
Uses a tag + union layout (#[repr(C)]) to minimize size. The struct is
40 bytes — a 2x reduction from the previous 80-byte enum. The tag is a
single byte; the remaining 7 bytes are padding for the 8-byte-aligned
FastStr (32 bytes) in the union.
§Variants
ValueTag::Null— JSONnullValueTag::Bool—boolValueTag::I64—i64ValueTag::U64—u64ValueTag::F64—f64ValueTag::Str— owned string viaFastStr(SSO for short strings)ValueTag::StaticStr—&'static str(zero-copy, zero-allocation)ValueTag::Array—Box<SmallVec<[Value; 8]>>ValueTag::Object—Box<WideEvent<K>>
§Conversions
All primitive types implement Into<Value<K>>:
bool→Booli64→I64u64→U64f64→F64&'static str→StaticStr(zero-copy)&str→Str(viaFastStr::new, SSO for short strings)String→Str(viaFastStr::from_string, takes ownership)FastStr→Str()→Null
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<K> Freeze for Value<K>
impl<K> RefUnwindSafe for Value<K>
impl<K> Send for Value<K>
impl<K> Sync for Value<K>
impl<K> Unpin for Value<K>
impl<K> UnsafeUnpin for Value<K>
impl<K> UnwindSafe for Value<K>
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