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, with its equality and order
(data.md; types.md, Equality, ordering and text): constructors in
declaration order, Null lowest; numbers by value, so 1.0 is 1;
text by code point; lists element by element; and an object as a
Dict<Text, json.Value>, whatever order its members were written in.
It encodes as the JSON value it stands for.
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 FlowType for JsonValue
impl FlowType for JsonValue
Source§fn decode_context(
codec: &ContextCodec,
value: &Json,
) -> Result<Self, DecodeError>
fn decode_context( codec: &ContextCodec, value: &Json, ) -> Result<Self, DecodeError>
Reads a value using the compiler-validated concrete call type.
Source§fn encode_context(&self, codec: &ContextCodec) -> Result<Json, DecodeError>
fn encode_context(&self, codec: &ContextCodec) -> Result<Json, DecodeError>
Writes a value using the compiler-validated concrete call type.
Source§fn encode_field(&self) -> Option<Json>
fn encode_field(&self) -> Option<Json>
Encodes a named field, including the special Option-field representation.
Source§fn decode_field(value: Option<&Json>) -> Result<Self, DecodeError>
fn decode_field(value: Option<&Json>) -> Result<Self, DecodeError>
Decodes a named field; Option aliases retain omission semantics.
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
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