pub enum Value {
Null,
Bool(bool),
Number(Number),
String(String),
Array(Vec<Value>),
Object(Vec<(String, Value)>),
}Expand description
A parsed JSON value. Object members keep their text order; names are unique.
Variants§
Null
null
Bool(bool)
true or false
Number(Number)
A number, as parsed. Read it with Value::as_number_text; a number can only come
from parse.
String(String)
A string.
Array(Vec<Value>)
An array.
Object(Vec<(String, Value)>)
An object, members in text order.
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_number_text(&self) -> Option<&str>
pub fn as_number_text(&self) -> Option<&str>
The number exactly as written in the parsed text (e.g. 1.50, 1E3), if this is a
number. Value::to_jcs writes its double value in ECMAScript form instead.
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