pub struct Json(pub Value);
Expand description
JSON data.
Json
data type contains any valid json value.
ℹ️ The traits ToString
and TryToString
have different behavior for conversion:
ToString
, as infaillible, will give the literal JSON object string;TryToString
, as faillible, will give the internal string if JSON object is only a string, and none in the other cases.
Tuple Fields§
§0: Value
Trait Implementations§
Source§impl DataTrait for Json
impl DataTrait for Json
fn to_i8(&self) -> i8
fn to_i16(&self) -> i16
fn to_i32(&self) -> i32
fn to_i64(&self) -> i64
fn to_i128(&self) -> i128
fn to_u8(&self) -> u8
fn to_u16(&self) -> u16
fn to_u32(&self) -> u32
fn to_u64(&self) -> u64
fn to_u128(&self) -> u128
fn to_f32(&self) -> f32
fn to_f64(&self) -> f64
fn to_bool(&self) -> bool
fn to_byte(&self) -> u8
fn to_char(&self) -> char
fn to_string(&self) -> String
fn try_to_i8(&self) -> Option<i8>
fn try_to_i16(&self) -> Option<i16>
fn try_to_i32(&self) -> Option<i32>
fn try_to_i64(&self) -> Option<i64>
fn try_to_i128(&self) -> Option<i128>
fn try_to_u8(&self) -> Option<u8>
fn try_to_u16(&self) -> Option<u16>
fn try_to_u32(&self) -> Option<u32>
fn try_to_u64(&self) -> Option<u64>
fn try_to_u128(&self) -> Option<u128>
fn try_to_f32(&self) -> Option<f32>
fn try_to_f64(&self) -> Option<f64>
fn try_to_bool(&self) -> Option<bool>
fn try_to_byte(&self) -> Option<u8>
fn try_to_char(&self) -> Option<char>
fn try_to_string(&self) -> Option<String>
fn saturating_to_i8(&self) -> i8
fn saturating_to_i16(&self) -> i16
fn saturating_to_i32(&self) -> i32
fn saturating_to_i64(&self) -> i64
fn saturating_to_i128(&self) -> i128
fn saturating_to_u8(&self) -> u8
fn saturating_to_u16(&self) -> u16
fn saturating_to_u32(&self) -> u32
fn saturating_to_u64(&self) -> u64
fn saturating_to_u128(&self) -> u128
fn saturating_to_f32(&self) -> f32
fn saturating_to_f64(&self) -> f64
fn binary_and(&self, other: &Value) -> Value
fn binary_or(&self, other: &Value) -> Value
fn binary_xor(&self, other: &Value) -> Value
fn binary_not(&self) -> Value
fn signed_abs(&self) -> Option<Value>
fn signed_signum(&self) -> Value
fn signed_is_positive(&self) -> bool
fn signed_is_negative(&self) -> bool
fn float_is_nan(&self) -> bool
fn float_is_infinite(&self) -> bool
fn float_is_finite(&self) -> bool
fn float_is_normal(&self) -> bool
fn float_is_subnormal(&self) -> bool
fn float_floor(&self) -> Value
fn float_ceil(&self) -> Value
fn float_round(&self) -> Value
fn float_trunc(&self) -> Value
fn float_fract(&self) -> Value
fn float_recip(&self) -> Value
fn float_pow(&self, n: &Value) -> Value
fn float_sqrt(&self) -> Value
fn float_exp(&self) -> Value
fn float_exp2(&self) -> Value
fn float_ln(&self) -> Value
fn float_log(&self, base: &Value) -> Value
fn float_log2(&self) -> Value
fn float_log10(&self) -> Value
fn float_cbrt(&self) -> Value
fn float_hypot(&self, n: &Value) -> Value
fn float_sin(&self) -> Value
fn float_cos(&self) -> Value
fn float_tan(&self) -> Value
fn float_asin(&self) -> Value
fn float_acos(&self) -> Value
fn float_atan(&self) -> Value
fn float_atan2(&self, n: &Value) -> Value
fn float_sinh(&self) -> Value
fn float_cosh(&self) -> Value
fn float_tanh(&self) -> Value
fn float_asinh(&self) -> Value
fn float_acosh(&self) -> Value
fn float_atanh(&self) -> Value
fn float_to_degrees(&self) -> Value
fn float_to_radians(&self) -> Value
fn partial_equality_eq(&self, other: &Value) -> bool
fn partial_equality_ne(&self, other: &Value) -> bool
fn partial_order_lt(&self, other: &Value) -> bool
fn partial_order_le(&self, other: &Value) -> bool
fn partial_order_gt(&self, other: &Value) -> bool
fn partial_order_ge(&self, other: &Value) -> bool
fn order_max(&self, other: &Value) -> Value
fn order_min(&self, other: &Value) -> Value
fn order_clamp(&self, min: &Value, max: &Value) -> Value
fn add(&self, other: &Value) -> Value
fn checked_add(&self, other: &Value) -> Option<Value>
fn saturating_add(&self, other: &Value) -> Value
fn wrapping_add(&self, other: &Value) -> Value
fn sub(&self, other: &Value) -> Value
fn checked_sub(&self, other: &Value) -> Option<Value>
fn saturating_sub(&self, other: &Value) -> Value
fn wrapping_sub(&self, other: &Value) -> Value
fn mul(&self, other: &Value) -> Value
fn checked_mul(&self, other: &Value) -> Option<Value>
fn saturating_mul(&self, other: &Value) -> Value
fn wrapping_mul(&self, other: &Value) -> Value
fn div(&self, other: &Value) -> Value
fn checked_div(&self, other: &Value) -> Option<Value>
fn rem(&self, other: &Value) -> Value
fn checked_rem(&self, other: &Value) -> Option<Value>
fn neg(&self) -> Value
fn checked_neg(&self) -> Option<Value>
fn wrapping_neg(&self) -> Value
fn pow(&self, exp: &u32) -> Value
fn checked_pow(&self, exp: &u32) -> Option<Value>
fn euclid_div(&self, other: &Value) -> Value
fn euclid_rem(&self, other: &Value) -> Value
fn checked_euclid_div(&self, other: &Value) -> Option<Value>
fn checked_euclid_rem(&self, other: &Value) -> Option<Value>
fn hash(&self, _state: &mut dyn Hasher)
fn serialize( &self, _serializer: &mut dyn ErasedSerializer, ) -> Result<(), ErasedSerdeError>
fn display(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§impl TryToString for Json
impl TryToString for Json
fn try_to_string(&self) -> Option<string>
Auto Trait Implementations§
impl Freeze for Json
impl RefUnwindSafe for Json
impl Send for Json
impl Sync for Json
impl Unpin for Json
impl UnwindSafe for Json
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.