pub enum JsonValue {
Null,
Bool(bool),
Number(JsonNumber),
String(String),
Array(Vec<JsonValue>),
Object(BTreeMap<String, JsonValue>),
}Expand description
Inspectable JSON that preserves number tokens and rejects duplicate keys.
Variants§
Null
JSON null.
Bool(bool)
JSON boolean.
Number(JsonNumber)
Original, validated numeric token; no float conversion has occurred.
String(String)
Decoded Unicode text.
Array(Vec<JsonValue>)
Ordered array entries.
Object(BTreeMap<String, JsonValue>)
Unique object keys. Original ordering and escapes remain in reply bytes.
Implementations§
Source§impl JsonValue
impl JsonValue
Sourcepub fn parse(bytes: &[u8]) -> Result<Self, &'static str>
pub fn parse(bytes: &[u8]) -> Result<Self, &'static str>
Decode exactly one JSON value, preserving unknown full-width numbers. Errors contain no payload excerpts or decoded values.
Trait Implementations§
impl Eq 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