Enum air_interpreter_value::JValue

source ·
pub enum JValue {
    Null,
    Bool(bool),
    Number(Number),
    String(JsonString),
    Array(Rc<[JValue]>),
    Object(Rc<Map<JsonString, JValue>>),
}
Expand description

Represents any valid JSON value with a cheap to clone Rc-based representation.

Variants§

§

Null

Represents a JSON null value.

§

Bool(bool)

Represents a JSON boolean.

§

Number(Number)

Represents a JSON number, whether integer or floating point.

§

String(JsonString)

Represents a JSON string.

§

Array(Rc<[JValue]>)

Represents a JSON array.

§

Object(Rc<Map<JsonString, JValue>>)

Represents a JSON object.

By default the map is backed by a BTreeMap. Enable the preserve_order feature of serde_json to use IndexMap instead, which preserves entries in the order they are inserted into the map. In particular, this allows JSON data to be deserialized into a JValue and serialized to a string while retaining the order of map keys in the input.

Implementations§

source§

impl JValue

source

pub fn string(s: impl Into<Rc<str>>) -> Self

source

pub fn array(vec: impl Into<Rc<[JValue]>>) -> Self

source

pub fn array_from_iter( into_iter: impl IntoIterator<Item = impl Into<JValue>>, ) -> Self

source

pub fn object(map: impl Into<Map<JsonString, JValue>>) -> Self

source

pub fn object_from_pairs( into_iter: impl IntoIterator<Item = (impl Into<JsonString>, impl Into<JValue>)>, ) -> Self

source

pub fn get<I: Index>(&self, index: I) -> Option<&JValue>

Index into a JSON array or map. A string index can be used to access a value in a map, and a usize index can be used to access an element of an array.

Returns None if the type of self does not match the type of the index, for example if the index is a string and self is an array or a number. Also returns None if the given key does not exist in the map or the given index is not within the bounds of the array.

Square brackets can also be used to index into a value in a more concise way. This returns JValue::Null in cases where get would have returned None.

source

pub fn is_object(&self) -> bool

Returns true if the JValue is an Object. Returns false otherwise.

For any JValue on which is_object returns true, as_object and as_object_mut are guaranteed to return the map representation of the object.

source

pub fn as_object(&self) -> Option<&Map<JsonString, JValue>>

If the JValue is an Object, returns the associated Map. Returns None otherwise.

source

pub fn is_array(&self) -> bool

Returns true if the JValue is an Array. Returns false otherwise.

For any JValue on which is_array returns true, as_array and as_array_mut are guaranteed to return the vector representing the array.

source

pub fn as_array(&self) -> Option<&[JValue]>

If the JValue is an Array, returns the associated vector. Returns None otherwise.

source

pub fn is_string(&self) -> bool

Returns true if the JValue is a String. Returns false otherwise.

For any JValue on which is_string returns true, as_str is guaranteed to return the string slice.

source

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

If the JValue is a string, returns the associated str. Returns None otherwise.

source

pub fn is_number(&self) -> bool

Returns true if the JValue is a Number. Returns false otherwise.

source

pub fn as_number(&self) -> Option<&Number>

If the JValue is a Number, returns the associated Number. Returns None otherwise.

source

pub fn is_i64(&self) -> bool

Returns true if the JValue is an integer between i64::MIN and i64::MAX.

For any JValue on which is_i64 returns true, as_i64 is guaranteed to return the integer value.

source

pub fn is_u64(&self) -> bool

Returns true if the JValue is an integer between zero and u64::MAX.

For any JValue on which is_u64 returns true, as_u64 is guaranteed to return the integer value.

source

pub fn is_f64(&self) -> bool

Returns true if the JValue is a number that can be represented by f64.

For any JValue on which is_f64 returns true, as_f64 is guaranteed to return the floating point value.

Currently this function returns true if and only if both is_i64 and is_u64 return false but this is not a guarantee in the future.

source

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

If the JValue is an integer, represent it as i64 if possible. Returns None otherwise.

source

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

If the JValue is an integer, represent it as u64 if possible. Returns None otherwise.

source

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

If the JValue is a number, represent it as f64 if possible. Returns None otherwise.

source

pub fn is_boolean(&self) -> bool

Returns true if the JValue is a Boolean. Returns false otherwise.

For any JValue on which is_boolean returns true, as_bool is guaranteed to return the boolean value.

source

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

If the JValue is a Boolean, returns the associated bool. Returns None otherwise.

source

pub fn is_null(&self) -> bool

Returns true if the JValue is a Null. Returns false otherwise.

For any JValue on which is_null returns true, as_null is guaranteed to return Some(()).

source

pub fn as_null(&self) -> Option<()>

If the JValue is a Null, returns (). Returns None otherwise.

source

pub fn pointer(&self, pointer: &str) -> Option<&JValue>

Looks up a value by a JSON Pointer.

JSON Pointer defines a string syntax for identifying a specific value within a JavaScript Object Notation (JSON) document.

A Pointer is a Unicode string with the reference tokens separated by /. Inside tokens / is replaced by ~1 and ~ is replaced by ~0. The addressed value is returned and if there is no such value None is returned.

For more information read RFC6901.

source

pub fn take(&mut self) -> JValue

Takes the value out of the JValue, leaving a Null in its place.

Trait Implementations§

source§

impl Clone for JValue

source§

fn clone(&self) -> JValue

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 JValue

source§

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

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

impl Default for JValue

The default value is JValue::Null.

source§

fn default() -> JValue

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for JValue

source§

fn deserialize<D>(deserializer: D) -> Result<JValue, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for JValue

source§

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

Display a JSON value as a string.

source§

impl<T: Clone + Into<JValue>> From<&[T]> for JValue

source§

fn from(f: &[T]) -> Self

Convert a slice to JValue::Array.

§Examples
use air_interpreter_value::JValue;

let v: &[&str] = &["lorem", "ipsum", "dolor"];
let x: JValue = v.into();
source§

impl From<&Value> for JValue

source§

fn from(value: &Value) -> Self

Converts to this type from the input type.
source§

impl From<&str> for JValue

source§

fn from(f: &str) -> Self

Convert string slice to JValue::String.

§Examples
use air_interpreter_value::JValue;

let s: &str = "lorem";
let x: JValue = s.into();
source§

impl From<()> for JValue

source§

fn from((): ()) -> Self

Convert () to JValue::Null.

§Examples
use air_interpreter_value::JValue;

let u = ();
let x: JValue = u.into();
source§

impl From<BTreeMap<Rc<str>, JValue>> for JValue

source§

fn from(f: Map<JsonString, JValue>) -> Self

Convert map (with string keys) to JValue::Object.

§Examples
use air_interpreter_value::{Map, JValue, JsonString};

let mut m = Map::<JsonString, JValue>::new();
m.insert("Lorem".into(), "ipsum".into());
let x: JValue = m.into();
source§

impl<'a> From<Cow<'a, str>> for JValue

source§

fn from(f: Cow<'a, str>) -> Self

Convert copy-on-write string to JValue::String.

§Examples
use air_interpreter_value::JValue;
use std::borrow::Cow;

let s: Cow<str> = Cow::Borrowed("lorem");
let x: JValue = s.into();
use air_interpreter_value::JValue;
use std::borrow::Cow;

let s: Cow<str> = Cow::Owned("lorem".to_string());
let x: JValue = s.into();
source§

impl<K: Into<JsonString>, V: Into<JValue>> From<HashMap<K, V>> for JValue

source§

fn from(f: HashMap<K, V>) -> Self

Convert map (with string keys) to JValue::Object.

§Examples
use air_interpreter_value::JValue;
use std::collections::HashMap;

let mut m = HashMap::<&str, &str>::new();
m.insert("Lorem", "ipsum");
let x: JValue = m.into();
source§

impl From<Number> for JValue

source§

fn from(f: Number) -> Self

Convert serde_json::Number to JValue::Number.

§Examples
use serde_json::Number;
use air_interpreter_value::JValue;

let n = Number::from(7);
let x: JValue = n.into();
source§

impl<T> From<Option<T>> for JValue
where T: Into<JValue>,

source§

fn from(opt: Option<T>) -> Self

Converts to this type from the input type.
source§

impl From<Rc<str>> for JValue

source§

fn from(f: JsonString) -> Self

Convert JsonString to JValue::String.

§Examples
use air_interpreter_value::JValue;

let s: String = "lorem".to_string();
let x: JValue = s.into();
source§

impl From<String> for JValue

source§

fn from(f: String) -> Self

Convert String to JValue::String.

§Examples
use air_interpreter_value::JValue;

let s: String = "lorem".to_string();
let x: JValue = s.into();
source§

impl From<Value> for JValue

source§

fn from(value: Value) -> Self

Converts to this type from the input type.
source§

impl<T: Into<JValue>> From<Vec<T>> for JValue

source§

fn from(f: Vec<T>) -> Self

Convert a Vec to JValue::Array.

§Examples
use air_interpreter_value::JValue;

let v = vec!["lorem", "ipsum", "dolor"];
let x: JValue = v.into();
source§

impl From<bool> for JValue

source§

fn from(f: bool) -> Self

Convert boolean to JValue::Bool.

§Examples
use air_interpreter_value::JValue;

let b = false;
let x: JValue = b.into();
source§

impl From<f32> for JValue

source§

fn from(f: f32) -> Self

Convert 32-bit floating point number to JValue::Number, or JValue::Null if infinite or NaN.

§Examples
use air_interpreter_value::JValue;

let f: f32 = 13.37;
let x: JValue = f.into();
source§

impl From<f64> for JValue

source§

fn from(f: f64) -> Self

Convert 64-bit floating point number to JValue::Number, or JValue::Null if infinite or NaN.

§Examples
use air_interpreter_value::JValue;

let f: f64 = 13.37;
let x: JValue = f.into();
source§

impl From<i16> for JValue

source§

fn from(n: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for JValue

source§

fn from(n: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for JValue

source§

fn from(n: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for JValue

source§

fn from(n: i8) -> Self

Converts to this type from the input type.
source§

impl From<isize> for JValue

source§

fn from(n: isize) -> Self

Converts to this type from the input type.
source§

impl From<u16> for JValue

source§

fn from(n: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for JValue

source§

fn from(n: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for JValue

source§

fn from(n: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for JValue

source§

fn from(n: u8) -> Self

Converts to this type from the input type.
source§

impl From<usize> for JValue

source§

fn from(n: usize) -> Self

Converts to this type from the input type.
source§

impl<K: Into<JsonString>, V: Into<JValue>> FromIterator<(K, V)> for JValue

source§

fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self

Create a JValue::Object by collecting an iterator of key-value pairs.

§Examples
use air_interpreter_value::JValue;

let v: Vec<_> = vec![("lorem", 40), ("ipsum", 2)];
let x: JValue = v.into_iter().collect();
source§

impl<T: Into<JValue>> FromIterator<T> for JValue

source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Create a JValue::Array by collecting an iterator of array elements.

§Examples
use air_interpreter_value::JValue;

let v = std::iter::repeat(42).take(5);
let x: JValue = v.collect();
use air_interpreter_value::JValue;

let v: Vec<_> = vec!["lorem", "ipsum", "dolor"];
let x: JValue = v.into_iter().collect();
use std::iter::FromIterator;
use air_interpreter_value::JValue;

let x: JValue = JValue::from_iter(vec!["lorem", "ipsum", "dolor"]);
source§

impl<I> Index<I> for JValue
where I: Index,

source§

fn index(&self, index: I) -> &JValue

Index into a air_interpreter_value::JValue using the syntax value[0] or value["k"].

Returns JValue::Null if the type of self does not match the type of the index, for example if the index is a string and self is an array or a number. Also returns JValue::Null if the given key does not exist in the map or the given index is not within the bounds of the array.

For retrieving deeply nested values, you should have a look at the JValue::pointer method.

§

type Output = JValue

The returned type after indexing.
source§

impl PartialEq<&str> for JValue

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 PartialEq<JValue> for &str

source§

fn eq(&self, other: &JValue) -> 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<JValue> for String

source§

fn eq(&self, other: &JValue) -> 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<JValue> for bool

source§

fn eq(&self, other: &JValue) -> 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<JValue> for f32

source§

fn eq(&self, other: &JValue) -> 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<JValue> for f64

source§

fn eq(&self, other: &JValue) -> 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<JValue> for i16

source§

fn eq(&self, other: &JValue) -> 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<JValue> for i32

source§

fn eq(&self, other: &JValue) -> 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<JValue> for i64

source§

fn eq(&self, other: &JValue) -> 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<JValue> for i8

source§

fn eq(&self, other: &JValue) -> 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<JValue> for isize

source§

fn eq(&self, other: &JValue) -> 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<JValue> for str

source§

fn eq(&self, other: &JValue) -> 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<JValue> for u16

source§

fn eq(&self, other: &JValue) -> 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<JValue> for u32

source§

fn eq(&self, other: &JValue) -> 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<JValue> for u64

source§

fn eq(&self, other: &JValue) -> 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<JValue> for u8

source§

fn eq(&self, other: &JValue) -> 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<JValue> for usize

source§

fn eq(&self, other: &JValue) -> 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 JValue

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<bool> for &'a JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

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 JValue

source§

fn eq(&self, other: &JValue) -> 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 Serialize for JValue

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for JValue

source§

impl StructuralPartialEq for JValue

Auto Trait Implementations§

§

impl Freeze for JValue

§

impl RefUnwindSafe for JValue

§

impl !Send for JValue

§

impl !Sync for JValue

§

impl Unpin for JValue

§

impl UnwindSafe for JValue

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,