pub enum JsonValue {
Null,
Bool(bool),
Number(String),
String(String),
Array(Vec<Value>),
Object(Vec<(String, Value)>),
}Expand description
Lossless JSON value used by the document model. Dependency-free JSON value that preserves number lexemes and object order.
Variants§
Null
JSON null.
Bool(bool)
JSON boolean.
Number(String)
JSON number stored as its original lexical representation.
String(String)
JSON string.
Array(Vec<Value>)
JSON array.
Object(Vec<(String, Value)>)
JSON object represented as ordered key/value pairs.
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_object(&self) -> Option<&[(String, Value)]>
pub fn as_object(&self) -> Option<&[(String, Value)]>
Borrows object entries when this value is an object.
Sourcepub fn as_object_mut(&mut self) -> Option<&mut Vec<(String, Value)>>
pub fn as_object_mut(&mut self) -> Option<&mut Vec<(String, Value)>>
Mutably borrows object entries when this value is an object.
Sourcepub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
pub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
Mutably borrows array entries when this value is an array.
Sourcepub fn as_u64(&self) -> Option<u64>
pub fn as_u64(&self) -> Option<u64>
Parses a non-negative integer without changing its stored lexeme.
Sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
Parses a JSON number as f64 without changing its stored lexeme.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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