pub enum JsonValue {
Object(IndexMap<String, JsonValue>),
Array(Vec<JsonValue>),
String(String),
Number(f64),
Bool(bool),
Null,
}Variants§
Object(IndexMap<String, JsonValue>)
Array(Vec<JsonValue>)
String(String)
Number(f64)
Bool(bool)
Null
Implementations§
Source§impl JsonValue
impl JsonValue
pub fn from<S: AsRef<str>>(s: S) -> Result<JsonValue, ParseError>
pub fn new_object() -> JsonValue
pub fn new_array() -> JsonValue
pub fn new_string() -> JsonValue
pub fn new_number() -> JsonValue
pub fn new_bool() -> JsonValue
pub fn new_null() -> JsonValue
pub fn is_object(&self) -> bool
pub fn is_array(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_number(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn is_null(&self) -> bool
pub fn as_object(&self) -> Option<&IndexMap<String, JsonValue>>
pub fn as_array(&self) -> Option<&Vec<JsonValue>>
pub fn as_string(&self) -> Option<&String>
pub fn as_number(&self) -> Option<&f64>
pub fn as_bool(&self) -> Option<&bool>
pub fn as_null(&self) -> Option<&()>
pub fn into_object(self) -> Option<IndexMap<String, JsonValue>>
pub fn into_array(self) -> Option<Vec<JsonValue>>
pub fn into_string(self) -> Option<String>
pub fn into_number(self) -> Option<f64>
pub fn into_bool(self) -> Option<bool>
pub fn into_null(self) -> Option<()>
Trait Implementations§
impl Eq 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 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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.