Enum Value

Source
pub enum Value<T: Json> {
    Null,
    Boolean(bool),
    Number(T::Number),
    String(T::String),
    Array(T::Array),
    Object(T::Object),
}
Expand description

Any JSON value.

Variants§

§

Null

JSON null value.

§

Boolean(bool)

JSON boolean value (true or false).

§

Number(T::Number)

JSON number, wether integer of floating point.

§

String(T::String)

JSON string value.

§

Array(T::Array)

JSON array of values.

§

Object(T::Object)

JSON object.

Implementations§

Source§

impl<T: Json> Value<T>

Source

pub fn is_null(&self) -> bool

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

Source

pub fn is_bool(&self) -> bool

Returns true if the value is a boolean. Returns false otherwise.

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

Source

pub fn is_number(&self) -> bool

Returns true if the value is a number. Returns false otherwise.

For any value on which is_number returns true, as_number is guaranteed to return the number value.

Source

pub fn is_string(&self) -> bool

Returns true if the value is a string. Returns false otherwise.

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

Source

pub fn is_array(&self) -> bool

Returns true if the value is an array. Returns false otherwise.

For any value on which is_array returns true, as_array is guaranteed to return the array value.

Source

pub fn is_object(&self) -> bool

Returns true if the value is an object. Returns false otherwise.

For any value on which is_object returns true, as_object is guaranteed to return the object value.

Source

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

If the value is a boolean, returns the associated bool. Returns None otherwise.

Source

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

If the value is a number, returns a reference to it. Returns None otherwise.

Source

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

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

Source

pub fn as_array(&self) -> Option<&T::Array>

If the value is an array, returns a reference to it. Returns None otherwise.

Source

pub fn as_array_mut(&mut self) -> Option<&mut T::Array>

If the value is an array, returns a mutable reference to it. Returns None otherwise.

Source

pub fn as_object(&self) -> Option<&T::Object>

If the value is an object, returns a reference to it. Returns None otherwise.

Source

pub fn as_object_mut(&mut self) -> Option<&mut T::Object>

If the value is an object, returns a mutable reference to it. Returns None otherwise.

Source

pub fn as_value_ref(&self) -> ValueRef<'_, T>

Source

pub fn as_value_mut(&mut self) -> ValueMut<'_, T>

Source

pub fn take(&mut self) -> Self

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

Source§

impl<T: JsonNew> Value<T>
where T::String: for<'a> From<&'a str>,

Source

pub fn with(self, meta: T::MetaData) -> T

Source

pub fn with_default(self) -> T
where T::MetaData: Default,

Trait Implementations§

Source§

impl<T: Json> Clone for Value<T>
where T::Number: Clone, T::String: Clone, T::Array: Clone, T::Object: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate 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<T: Json> Debug for Value<T>
where T::Number: Debug, T::String: Debug, T::Array: Debug, T::Object: Debug,

Source§

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

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

impl<T: Json> Default for Value<T>

Source§

fn default() -> Self

The default value is Value::Null.

Source§

impl<'a, T: Json> From<&'a [Value<T>]> for Value<T>
where T::Array: From<&'a [Value<T>]>,

Source§

fn from(a: &'a [Value<T>]) -> Self

Converts to this type from the input type.
Source§

impl<'a, T: Json> From<&'a str> for Value<T>
where T::String: From<&'a str>,

Source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<()> for Value<T>

Source§

fn from(_: ()) -> Self

Converts to this type from the input type.
Source§

impl<'a, T: Json> From<Cow<'a, str>> for Value<T>
where T::String: From<Cow<'a, str>>,

Source§

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

Converts to this type from the input type.
Source§

impl<J: Json> From<J> for Value<J>

Source§

fn from(j: J) -> Value<J>

Converts to this type from the input type.
Source§

impl<T: Json> From<String> for Value<T>
where T::String: From<String>,

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<Vec<Value<T>>> for Value<T>
where T::Array: From<Vec<Value<T>>>,

Source§

fn from(a: Vec<Value<T>>) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<bool> for Value<T>

Source§

fn from(b: bool) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<f32> for Value<T>
where T::Number: From<f32>,

Source§

fn from(n: f32) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<f64> for Value<T>
where T::Number: From<f64>,

Source§

fn from(n: f64) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<i16> for Value<T>
where T::Number: From<i16>,

Source§

fn from(n: i16) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<i32> for Value<T>
where T::Number: From<i32>,

Source§

fn from(n: i32) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<i64> for Value<T>
where T::Number: From<i64>,

Source§

fn from(n: i64) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<i8> for Value<T>
where T::Number: From<i8>,

Source§

fn from(n: i8) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<isize> for Value<T>
where T::Number: From<isize>,

Source§

fn from(n: isize) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<u16> for Value<T>
where T::Number: From<u16>,

Source§

fn from(n: u16) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<u32> for Value<T>
where T::Number: From<u32>,

Source§

fn from(n: u32) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<u64> for Value<T>
where T::Number: From<u64>,

Source§

fn from(n: u64) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<u8> for Value<T>
where T::Number: From<u8>,

Source§

fn from(n: u8) -> Self

Converts to this type from the input type.
Source§

impl<T: Json> From<usize> for Value<T>
where T::Number: From<usize>,

Source§

fn from(n: usize) -> Self

Converts to this type from the input type.
Source§

impl<T: Json, V: Into<Self>> FromIterator<V> for Value<T>
where T::Array: FromIterator<Self>,

Source§

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

Creates a value from an iterator. Read more
Source§

impl<T: Json> Hash for Value<T>
where T::Number: Hash, T::String: Hash, T::Array: Hash, T::Object: Hash,

Source§

fn hash<H: Hasher>(&self, h: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, T: Json> PartialEq<&'a str> for Value<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<String> for Value<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for f32
where f32: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for f64
where f64: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for i16
where i16: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for i32
where i32: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for i64
where i64: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for i8
where i8: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for isize
where isize: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for u16
where u16: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for u32
where u32: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for u64
where u64: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for u8
where u8: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<Value<T>> for usize
where usize: PartialEq<T::Number>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json, U: Json> PartialEq<Value<U>> for Value<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<bool> for Value<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<f32> for &'a Value<T>
where T::Number: PartialEq<f32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<f32> for &'a mut Value<T>
where T::Number: PartialEq<f32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<f32> for Value<T>
where T::Number: PartialEq<f32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<f64> for &'a Value<T>
where T::Number: PartialEq<f64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<f64> for &'a mut Value<T>
where T::Number: PartialEq<f64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<f64> for Value<T>
where T::Number: PartialEq<f64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<i16> for &'a Value<T>
where T::Number: PartialEq<i16>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<i16> for &'a mut Value<T>
where T::Number: PartialEq<i16>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<i16> for Value<T>
where T::Number: PartialEq<i16>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<i32> for &'a Value<T>
where T::Number: PartialEq<i32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<i32> for &'a mut Value<T>
where T::Number: PartialEq<i32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<i32> for Value<T>
where T::Number: PartialEq<i32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<i64> for &'a Value<T>
where T::Number: PartialEq<i64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<i64> for &'a mut Value<T>
where T::Number: PartialEq<i64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<i64> for Value<T>
where T::Number: PartialEq<i64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<i8> for &'a Value<T>
where T::Number: PartialEq<i8>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<i8> for &'a mut Value<T>
where T::Number: PartialEq<i8>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<i8> for Value<T>
where T::Number: PartialEq<i8>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<isize> for &'a Value<T>
where T::Number: PartialEq<isize>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<isize> for &'a mut Value<T>
where T::Number: PartialEq<isize>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<isize> for Value<T>
where T::Number: PartialEq<isize>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<u16> for &'a Value<T>
where T::Number: PartialEq<u16>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<u16> for &'a mut Value<T>
where T::Number: PartialEq<u16>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<u16> for Value<T>
where T::Number: PartialEq<u16>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<u32> for &'a Value<T>
where T::Number: PartialEq<u32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<u32> for &'a mut Value<T>
where T::Number: PartialEq<u32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<u32> for Value<T>
where T::Number: PartialEq<u32>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<u64> for &'a Value<T>
where T::Number: PartialEq<u64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<u64> for &'a mut Value<T>
where T::Number: PartialEq<u64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<u64> for Value<T>
where T::Number: PartialEq<u64>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<u8> for &'a Value<T>
where T::Number: PartialEq<u8>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<u8> for &'a mut Value<T>
where T::Number: PartialEq<u8>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<u8> for Value<T>
where T::Number: PartialEq<u8>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<usize> for &'a Value<T>
where T::Number: PartialEq<usize>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T: Json> PartialEq<usize> for &'a mut Value<T>
where T::Number: PartialEq<usize>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json> PartialEq<usize> for Value<T>
where T::Number: PartialEq<usize>,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Json, U: Json> PartialOrd<Value<U>> for Value<T>

Source§

fn partial_cmp(&self, other: &Value<U>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: Json> Eq for Value<T>
where T::Number: Eq, T::String: Eq, T::Array: Eq, T::Object: Eq,

Auto Trait Implementations§

§

impl<T> Freeze for Value<T>
where <T as Json>::Number: Freeze, <T as Json>::String: Freeze, <T as Json>::Array: Freeze, <T as Json>::Object: Freeze,

§

impl<T> RefUnwindSafe for Value<T>

§

impl<T> Send for Value<T>
where <T as Json>::Number: Send, <T as Json>::String: Send, <T as Json>::Array: Send, <T as Json>::Object: Send,

§

impl<T> Sync for Value<T>
where <T as Json>::Number: Sync, <T as Json>::String: Sync, <T as Json>::Array: Sync, <T as Json>::Object: Sync,

§

impl<T> Unpin for Value<T>
where <T as Json>::Number: Unpin, <T as Json>::String: Unpin, <T as Json>::Array: Unpin, <T as Json>::Object: Unpin,

§

impl<T> UnwindSafe for Value<T>
where <T as Json>::Number: UnwindSafe, <T as Json>::String: UnwindSafe, <T as Json>::Array: UnwindSafe, <T as Json>::Object: UnwindSafe,

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.