Enum json::JsonValue

source ·
pub enum JsonValue {
    String(String),
    Number(f64),
    Boolean(bool),
    Null,
    Object(BTreeMap<String, JsonValue>),
    Array(Vec<JsonValue>),
}

Variants§

§

String(String)

§

Number(f64)

§

Boolean(bool)

§

Null

§

Object(BTreeMap<String, JsonValue>)

§

Array(Vec<JsonValue>)

Implementations§

source§

impl JsonValue

source

pub fn new_object() -> JsonValue

Create an empty JsonValue::Object instance. When creating an object with data, consider using the object! macro.

source

pub fn new_array() -> JsonValue

Create an empty JsonValue::Array instance. When creating array with data, consider using the array! macro.

source

pub fn is_string(&self) -> bool

source

pub fn is_number(&self) -> bool

source

pub fn is_boolean(&self) -> bool

source

pub fn is_null(&self) -> bool

source

pub fn is_object(&self) -> bool

source

pub fn is_array(&self) -> bool

source

pub fn is_empty(&self) -> bool

Checks whether the value is empty. Returns true for:

  • empty string ("")
  • number 0
  • boolean false
  • null
  • empty array (array![])
  • empty object (object!{})
source

pub fn as_str(&self) -> Option<&str>

source

pub fn as_f64(&self) -> Option<f64>

source

pub fn as_f32(&self) -> Option<f32>

source

pub fn as_u64(&self) -> Option<u64>

source

pub fn as_u32(&self) -> Option<u32>

source

pub fn as_u16(&self) -> Option<u16>

source

pub fn as_u8(&self) -> Option<u8>

source

pub fn as_usize(&self) -> Option<usize>

source

pub fn as_i64(&self) -> Option<i64>

source

pub fn as_i32(&self) -> Option<i32>

source

pub fn as_i16(&self) -> Option<i16>

source

pub fn as_i8(&self) -> Option<i8>

source

pub fn as_isize(&self) -> Option<isize>

source

pub fn as_bool(&self) -> Option<bool>

source

pub fn push<T>(&mut self, value: T) -> JsonResult<()>
where T: Into<JsonValue>,

Works on JsonValue::Array - pushes a new value to the array.

source

pub fn pop(&mut self) -> JsonValue

Works on JsonValue::Array - remove and return last element from an array. On failure returns a null.

source

pub fn contains<T>(&self, item: T) -> bool
where T: Into<JsonValue>,

Works on JsonValue::Array - checks if the array contains a value

source

pub fn len(&self) -> usize

Returns length of array or object (number of keys), defaults to 0 for other types.

source

pub fn members(&self) -> Members<'_>

Works on JsonValue::Array - returns an iterator over members.

source

pub fn members_mut(&mut self) -> MembersMut<'_>

Works on JsonValue::Array - returns a mutable iterator over members.

source

pub fn entries(&self) -> Entries<'_>

Works on JsonValue::Object - returns an iterator over key value pairs.

source

pub fn entries_mut(&mut self) -> EntriesMut<'_>

Works on JsonValue::Object - returns a mutable iterator over key value pairs.

source

pub fn remove(&mut self, key: &str) -> JsonValue

Works on JsonValue::Object - remove a key and return the value it held. If the key was not present, the method is called on anything but an object, it will return a null.

source

pub fn clear(&mut self)

When called on an array or an object, will wipe them clean. When called on a string will clear the string. Numbers and booleans become null.

source§

impl JsonValue

source

pub fn dump(&self) -> String

Prints out the value as JSON string.

source

pub fn pretty(&self, spaces: u16) -> String

Pretty prints out the value as JSON string. Takes an argument that’s number of spaces to indent new blocks with.

Trait Implementations§

source§

impl Clone for JsonValue

source§

fn clone(&self) -> JsonValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for JsonValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for JsonValue

Implements formatting

let data = json::parse(r#"{"url":"https://github.com/"}"#).unwrap();
println!("{}", data);
println!("{:#}", data);
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a str> for JsonValue

source§

fn from(val: &'a str) -> JsonValue

Converts to this type from the input type.
source§

impl From<BTreeMap<String, JsonValue>> for JsonValue

source§

fn from(val: Object) -> JsonValue

Converts to this type from the input type.
source§

impl From<HashMap<String, JsonValue>> for JsonValue

source§

fn from(val: HashMap<String, JsonValue>) -> JsonValue

Converts to this type from the input type.
source§

impl<'a> From<Option<&'a str>> for JsonValue

source§

fn from(val: Option<&'a str>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<BTreeMap<String, JsonValue>>> for JsonValue

source§

fn from(val: Option<Object>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<HashMap<String, JsonValue>>> for JsonValue

source§

fn from(val: Option<HashMap<String, JsonValue>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<JsonValue>> for JsonValue

source§

fn from(val: Option<JsonValue>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<String>> for JsonValue

source§

fn from(val: Option<String>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<Vec<JsonValue>>> for JsonValue

source§

fn from(val: Option<Array>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<bool>> for JsonValue

source§

fn from(val: Option<bool>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<f32>> for JsonValue

source§

fn from(val: Option<f32>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<f64>> for JsonValue

source§

fn from(val: Option<f64>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<i16>> for JsonValue

source§

fn from(val: Option<i16>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<i32>> for JsonValue

source§

fn from(val: Option<i32>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<i64>> for JsonValue

source§

fn from(val: Option<i64>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<i8>> for JsonValue

source§

fn from(val: Option<i8>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<isize>> for JsonValue

source§

fn from(val: Option<isize>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<u16>> for JsonValue

source§

fn from(val: Option<u16>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<u32>> for JsonValue

source§

fn from(val: Option<u32>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<u64>> for JsonValue

source§

fn from(val: Option<u64>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<u8>> for JsonValue

source§

fn from(val: Option<u8>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Option<usize>> for JsonValue

source§

fn from(val: Option<usize>) -> JsonValue

Converts to this type from the input type.
source§

impl From<String> for JsonValue

source§

fn from(val: String) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<BTreeMap<String, JsonValue>>> for JsonValue

source§

fn from(val: Vec<Object>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<JsonValue>> for JsonValue

source§

fn from(val: Array) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<BTreeMap<String, JsonValue>>>> for JsonValue

source§

fn from(val: Vec<Option<Object>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<String>>> for JsonValue

source§

fn from(val: Vec<Option<String>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<Vec<JsonValue>>>> for JsonValue

source§

fn from(val: Vec<Option<Array>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<bool>>> for JsonValue

source§

fn from(val: Vec<Option<bool>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<f32>>> for JsonValue

source§

fn from(val: Vec<Option<f32>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<f64>>> for JsonValue

source§

fn from(val: Vec<Option<f64>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<i16>>> for JsonValue

source§

fn from(val: Vec<Option<i16>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<i32>>> for JsonValue

source§

fn from(val: Vec<Option<i32>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<i64>>> for JsonValue

source§

fn from(val: Vec<Option<i64>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<i8>>> for JsonValue

source§

fn from(val: Vec<Option<i8>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<isize>>> for JsonValue

source§

fn from(val: Vec<Option<isize>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<u16>>> for JsonValue

source§

fn from(val: Vec<Option<u16>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<u32>>> for JsonValue

source§

fn from(val: Vec<Option<u32>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<u64>>> for JsonValue

source§

fn from(val: Vec<Option<u64>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<u8>>> for JsonValue

source§

fn from(val: Vec<Option<u8>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Option<usize>>> for JsonValue

source§

fn from(val: Vec<Option<usize>>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<String>> for JsonValue

source§

fn from(val: Vec<String>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<Vec<JsonValue>>> for JsonValue

source§

fn from(val: Vec<Array>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<bool>> for JsonValue

source§

fn from(val: Vec<bool>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<f32>> for JsonValue

source§

fn from(val: Vec<f32>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<f64>> for JsonValue

source§

fn from(val: Vec<f64>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<i16>> for JsonValue

source§

fn from(val: Vec<i16>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<i32>> for JsonValue

source§

fn from(val: Vec<i32>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<i64>> for JsonValue

source§

fn from(val: Vec<i64>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<i8>> for JsonValue

source§

fn from(val: Vec<i8>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<isize>> for JsonValue

source§

fn from(val: Vec<isize>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<u16>> for JsonValue

source§

fn from(val: Vec<u16>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<u32>> for JsonValue

source§

fn from(val: Vec<u32>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<u64>> for JsonValue

source§

fn from(val: Vec<u64>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<u8>> for JsonValue

source§

fn from(val: Vec<u8>) -> JsonValue

Converts to this type from the input type.
source§

impl From<Vec<usize>> for JsonValue

source§

fn from(val: Vec<usize>) -> JsonValue

Converts to this type from the input type.
source§

impl From<bool> for JsonValue

source§

fn from(val: bool) -> JsonValue

Converts to this type from the input type.
source§

impl From<f32> for JsonValue

source§

fn from(val: f32) -> JsonValue

Converts to this type from the input type.
source§

impl From<f64> for JsonValue

source§

fn from(val: f64) -> JsonValue

Converts to this type from the input type.
source§

impl From<i16> for JsonValue

source§

fn from(val: i16) -> JsonValue

Converts to this type from the input type.
source§

impl From<i32> for JsonValue

source§

fn from(val: i32) -> JsonValue

Converts to this type from the input type.
source§

impl From<i64> for JsonValue

source§

fn from(val: i64) -> JsonValue

Converts to this type from the input type.
source§

impl From<i8> for JsonValue

source§

fn from(val: i8) -> JsonValue

Converts to this type from the input type.
source§

impl From<isize> for JsonValue

source§

fn from(val: isize) -> JsonValue

Converts to this type from the input type.
source§

impl From<u16> for JsonValue

source§

fn from(val: u16) -> JsonValue

Converts to this type from the input type.
source§

impl From<u32> for JsonValue

source§

fn from(val: u32) -> JsonValue

Converts to this type from the input type.
source§

impl From<u64> for JsonValue

source§

fn from(val: u64) -> JsonValue

Converts to this type from the input type.
source§

impl From<u8> for JsonValue

source§

fn from(val: u8) -> JsonValue

Converts to this type from the input type.
source§

impl From<usize> for JsonValue

source§

fn from(val: usize) -> JsonValue

Converts to this type from the input type.
source§

impl<'a> Index<&'a String> for JsonValue

§

type Output = JsonValue

The returned type after indexing.
source§

fn index(&self, index: &String) -> &JsonValue

Performs the indexing (container[index]) operation. Read more
source§

impl<'a> Index<&'a str> for JsonValue

Implements indexing by &str to easily access object members:

let object = object!{
    "foo" => "bar"
};

assert!(object["foo"] == "bar");
§

type Output = JsonValue

The returned type after indexing.
source§

fn index(&self, index: &str) -> &JsonValue

Performs the indexing (container[index]) operation. Read more
source§

impl Index<String> for JsonValue

§

type Output = JsonValue

The returned type after indexing.
source§

fn index(&self, index: String) -> &JsonValue

Performs the indexing (container[index]) operation. Read more
source§

impl Index<usize> for JsonValue

Implements indexing by usize to easily access array members:

let mut array = JsonValue::new_array();

array.push("foo");

assert!(array[0] == "foo");
§

type Output = JsonValue

The returned type after indexing.
source§

fn index(&self, index: usize) -> &JsonValue

Performs the indexing (container[index]) operation. Read more
source§

impl<'a> IndexMut<&'a String> for JsonValue

source§

fn index_mut(&mut self, index: &String) -> &mut JsonValue

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a> IndexMut<&'a str> for JsonValue

Implements mutable indexing by &str to easily modify object members:

let mut object = object!{};

object["foo"] = 42.into();

assert!(object["foo"] == 42);
source§

fn index_mut(&mut self, index: &str) -> &mut JsonValue

Performs the mutable indexing (container[index]) operation. Read more
source§

impl IndexMut<String> for JsonValue

source§

fn index_mut(&mut self, index: String) -> &mut JsonValue

Performs the mutable indexing (container[index]) operation. Read more
source§

impl IndexMut<usize> for JsonValue

Implements mutable indexing by usize to easily modify array members:

let mut array = array!["foo", 3.14];

array[1] = "bar".into();

assert!(array[1] == "bar");
source§

fn index_mut(&mut self, index: usize) -> &mut JsonValue

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a> PartialEq<&'a str> for JsonValue

source§

fn eq(&self, other: &&str) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<BTreeMap<String, JsonValue>> for &'a JsonValue

source§

fn eq(&self, other: &Object) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<BTreeMap<String, JsonValue>> for JsonValue

source§

fn eq(&self, other: &Object) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<JsonValue> for &'a str

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for Object

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for String

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for Array

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for bool

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for f32

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for f64

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for i16

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for i32

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for i64

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for i8

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for isize

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<JsonValue> for str

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for u16

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for u32

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for u64

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for u8

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<JsonValue> for usize

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<String> for &'a JsonValue

source§

fn eq(&self, other: &String) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<String> for JsonValue

source§

fn eq(&self, other: &String) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<Vec<JsonValue>> for &'a JsonValue

source§

fn eq(&self, other: &Array) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Vec<JsonValue>> for JsonValue

source§

fn eq(&self, other: &Array) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<bool> for &'a JsonValue

source§

fn eq(&self, other: &bool) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<bool> for JsonValue

source§

fn eq(&self, other: &bool) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<f32> for &'a JsonValue

source§

fn eq(&self, other: &f32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<f32> for JsonValue

source§

fn eq(&self, other: &f32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<f64> for &'a JsonValue

source§

fn eq(&self, other: &f64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<f64> for JsonValue

source§

fn eq(&self, other: &f64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<i16> for &'a JsonValue

source§

fn eq(&self, other: &i16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i16> for JsonValue

source§

fn eq(&self, other: &i16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<i32> for &'a JsonValue

source§

fn eq(&self, other: &i32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i32> for JsonValue

source§

fn eq(&self, other: &i32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<i64> for &'a JsonValue

source§

fn eq(&self, other: &i64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i64> for JsonValue

source§

fn eq(&self, other: &i64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<i8> for &'a JsonValue

source§

fn eq(&self, other: &i8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<i8> for JsonValue

source§

fn eq(&self, other: &i8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<isize> for &'a JsonValue

source§

fn eq(&self, other: &isize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<isize> for JsonValue

source§

fn eq(&self, other: &isize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<str> for JsonValue

source§

fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<u16> for &'a JsonValue

source§

fn eq(&self, other: &u16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u16> for JsonValue

source§

fn eq(&self, other: &u16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<u32> for &'a JsonValue

source§

fn eq(&self, other: &u32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u32> for JsonValue

source§

fn eq(&self, other: &u32) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<u64> for &'a JsonValue

source§

fn eq(&self, other: &u64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u64> for JsonValue

source§

fn eq(&self, other: &u64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<u8> for &'a JsonValue

source§

fn eq(&self, other: &u8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u8> for JsonValue

source§

fn eq(&self, other: &u8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialEq<usize> for &'a JsonValue

source§

fn eq(&self, other: &usize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<usize> for JsonValue

source§

fn eq(&self, other: &usize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for JsonValue

source§

fn eq(&self, other: &JsonValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for JsonValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.