pub enum JsonV<K>{
Boolean(bool),
Int64(i64),
Int32(i32),
Float64(f64),
Float32(f32),
String(String),
Array(Vec<JsonV<K>>),
Object(JsonMap<K>),
}Expand description
This enum type supports storing values of multiple types including floats, integers, strings, arrays, and objects within a map.
The generic parameter K in JsonV<K>is used exclusively as a key within the Object objects. Typically, keys can be basic types such as strings, i32, i64, for instance Json<String>, JsonMap<String>, JsonMap<i64>.
zh-cn
通过枚举类型支持,Map内的值可以同时存储浮点型、整数、字符串、数组和对象类型。JsonV<K>中的泛型参数K仅在内部的Object对象中作为Key使用。通常,Key可以是字符串、i32、i64等基础类型,例如 Json<String>,JsonMap<String>,JsonMap<i64> .Variants§
Boolean(bool)
Int64(i64)
Int32(i32)
Float64(f64)
Float32(f32)
String(String)
Array(Vec<JsonV<K>>)
Object(JsonMap<K>)
Trait Implementations§
Source§impl<'de, K> Deserialize<'de> for JsonV<K>
impl<'de, K> Deserialize<'de> for JsonV<K>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<K> Freeze for JsonV<K>
impl<K> RefUnwindSafe for JsonV<K>where
K: RefUnwindSafe,
impl<K> Send for JsonV<K>where
K: Send,
impl<K> Sync for JsonV<K>where
K: Sync,
impl<K> Unpin for JsonV<K>where
K: Unpin,
impl<K> UnwindSafe for JsonV<K>where
K: UnwindSafe,
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