pub enum JsonValue {
Null,
Bool(bool),
Number(String),
String(String),
Array(Vec<JsonValue>),
Object(Vec<(String, JsonValue)>),
}Expand description
A JSON value. Objects keep their members in insertion order (a Vec of pairs, not a map) so a
serialized packet is byte-stable.
Variants§
Null
null.
Bool(bool)
true / false.
Number(String)
A number, kept as its literal text (so integer/decimal formatting round-trips exactly).
String(String)
A string.
Array(Vec<JsonValue>)
An ordered array.
Object(Vec<(String, JsonValue)>)
An ordered object: (key, value) members in insertion order.
Implementations§
Trait Implementations§
impl StructuralPartialEq for JsonValue
Auto Trait Implementations§
impl Freeze for JsonValue
impl RefUnwindSafe for JsonValue
impl Send for JsonValue
impl Sync for JsonValue
impl Unpin for JsonValue
impl UnsafeUnpin for JsonValue
impl UnwindSafe for JsonValue
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