pub enum Value<K: Key> {
Null,
Bool(bool),
I64(i64),
U64(u64),
F64(f64),
String(FastStr),
Array(SmallVec<[Box<Value<K>>; 8]>),
Object(Box<WideEvent<K>>),
}Expand description
A JSON value stored in a wide event.
This enum is generic over the key type K because Object and Array
variants can contain nested WideEvents that are parameterized by K.
§Conversions
All primitive types implement Into<Value<K>>:
bool→Value::Booli64→Value::I64u64→Value::U64f64→Value::F64&str,String,FastStr→Value::String()→Value::Null
The wl_set! and wl_null! macros use these conversions transparently.
Variants§
Null
JSON null.
Bool(bool)
A boolean value.
I64(i64)
A signed 64-bit integer.
U64(u64)
An unsigned 64-bit integer.
F64(f64)
A 64-bit floating-point value.
String(FastStr)
A string value, stored with small-string optimization via FastStr.
Array(SmallVec<[Box<Value<K>>; 8]>)
A JSON array of values.
Object(Box<WideEvent<K>>)
A nested JSON object (a boxed WideEvent).
Trait Implementations§
Auto Trait Implementations§
impl<K> !RefUnwindSafe for Value<K>
impl<K> !UnwindSafe for Value<K>
impl<K> Freeze for Value<K>
impl<K> Send for Value<K>where
K: Send,
impl<K> Sync for Value<K>where
K: Sync,
impl<K> Unpin for Value<K>
impl<K> UnsafeUnpin 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