pub enum JsonElement {
Null,
Boolean(bool),
Number(f64),
String(String),
Array(Vec<JsonElement>),
Object(Vec<(String, JsonElement)>),
}
Expand description
A representation of a JSON element.
Variants§
Null
A literal null
value
Boolean(bool)
A boolean value (true
/ false
)
Number(f64)
A numeric value
String(String)
A string value. Escape characters and sequences have already been parsed in the contained String.
Array(Vec<JsonElement>)
An array containing any number of other JSON elements.
Object(Vec<(String, JsonElement)>)
A JSON object, consisting of a series of key-value pairs.
The pairs are represented using a Vec and are provided in the same order in which they are defined in the original source.
The String keys within a JsonElement::Object are guaranteed to be unique.
Trait Implementations§
Source§impl Clone for JsonElement
impl Clone for JsonElement
Source§fn clone(&self) -> JsonElement
fn clone(&self) -> JsonElement
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for JsonElement
impl Debug for JsonElement
Source§impl Default for JsonElement
impl Default for JsonElement
Source§fn default() -> JsonElement
fn default() -> JsonElement
Returns the “default value” for a type. Read more
Source§impl PartialEq for JsonElement
impl PartialEq for JsonElement
impl StructuralPartialEq for JsonElement
Auto Trait Implementations§
impl Freeze for JsonElement
impl RefUnwindSafe for JsonElement
impl Send for JsonElement
impl Sync for JsonElement
impl Unpin for JsonElement
impl UnwindSafe for JsonElement
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