pub enum JsonValue {
Null,
Bool(bool),
Number(Decimal),
Text(String),
List(Vec<JsonValue>),
Object(BTreeMap<String, JsonValue>),
}Expand description
json.Value, std’s enum for raw JSON: its constructors Null, Bool,
Number, Text, List and Object in std’s order, an object a
Dict<Text, json.Value>.
Variants§
Null
null.
Bool(bool)
true or false.
Number(Decimal)
A number, exactly.
Text(String)
A string.
List(Vec<JsonValue>)
An array.
Object(BTreeMap<String, JsonValue>)
An object, its members by name.
Trait Implementations§
impl Eq for JsonValue
Source§impl Ord for JsonValue
impl Ord for JsonValue
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for JsonValue
impl PartialOrd for JsonValue
Source§impl Shaped for JsonValue
impl Shaped for JsonValue
Source§fn write_at(
&self,
out: &mut ValueWriter<'_, '_>,
ty: &Type,
) -> Result<(), EncodeError>
fn write_at( &self, out: &mut ValueWriter<'_, '_>, ty: &Type, ) -> Result<(), EncodeError>
Source§fn read_at(
input: &mut ValueReader<'_, '_, '_>,
ty: &Type,
) -> Result<Self, DecodeError>
fn read_at( input: &mut ValueReader<'_, '_, '_>, ty: &Type, ) -> Result<Self, DecodeError>
impl StructuralPartialEq for JsonValue
Auto Trait Implementations§
impl Forget for JsonValue
impl Freeze for JsonValuewhere
*const u8 is !null: Freeze,
PhantomData<u64>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<JsonValue>: Freeze,
*const LeafNode<String, JsonValue> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, JsonValue)>>: Freeze,
impl Move for JsonValue
impl RefUnwindSafe for JsonValue
impl Send for JsonValue
impl Sync for JsonValue
impl Unpin for JsonValue
impl UnsafeUnpin for JsonValuewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<JsonValue>: UnsafeUnpin,
*const LeafNode<String, JsonValue> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, JsonValue)>>: UnsafeUnpin,
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