Value

Enum Value 

Source
pub enum Value {
Show 20 variants Void(()), I8(i8), I16(i16), I32(i32), I64(i64), I128(i128), U8(u8), U16(u16), U32(u32), U64(u64), U128(u128), F32(f32), F64(f64), Bool(bool), Byte(u8), Char(char), String(String), Vec(Vec<Value>), Option(Option<Box<Value>>), Data(Arc<dyn Data>),
}

Variants§

§

Void(())

§

I8(i8)

§

I16(i16)

§

I32(i32)

§

I64(i64)

§

I128(i128)

§

U8(u8)

§

U16(u16)

§

U32(u32)

§

U64(u64)

§

U128(u128)

§

F32(f32)

§

F64(f64)

§

Bool(bool)

§

Byte(u8)

§

Char(char)

§

String(String)

§

Vec(Vec<Value>)

§

Option(Option<Box<Value>>)

§

Data(Arc<dyn Data>)

Implementations§

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

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 DataTrait for Value

Source§

fn to_i8(&self) -> i8

Source§

fn to_i16(&self) -> i16

Source§

fn to_i32(&self) -> i32

Source§

fn to_i64(&self) -> i64

Source§

fn to_i128(&self) -> i128

Source§

fn to_u8(&self) -> u8

Source§

fn to_u16(&self) -> u16

Source§

fn to_u32(&self) -> u32

Source§

fn to_u64(&self) -> u64

Source§

fn to_u128(&self) -> u128

Source§

fn to_f32(&self) -> f32

Source§

fn to_f64(&self) -> f64

Source§

fn to_bool(&self) -> bool

Source§

fn to_byte(&self) -> u8

Source§

fn to_char(&self) -> char

Source§

fn to_string(&self) -> String

Source§

fn try_to_i8(&self) -> Option<i8>

Source§

fn try_to_i16(&self) -> Option<i16>

Source§

fn try_to_i32(&self) -> Option<i32>

Source§

fn try_to_i64(&self) -> Option<i64>

Source§

fn try_to_i128(&self) -> Option<i128>

Source§

fn try_to_u8(&self) -> Option<u8>

Source§

fn try_to_u16(&self) -> Option<u16>

Source§

fn try_to_u32(&self) -> Option<u32>

Source§

fn try_to_u64(&self) -> Option<u64>

Source§

fn try_to_u128(&self) -> Option<u128>

Source§

fn try_to_f32(&self) -> Option<f32>

Source§

fn try_to_f64(&self) -> Option<f64>

Source§

fn try_to_bool(&self) -> Option<bool>

Source§

fn try_to_byte(&self) -> Option<u8>

Source§

fn try_to_char(&self) -> Option<char>

Source§

fn try_to_string(&self) -> Option<String>

Source§

fn saturating_to_i8(&self) -> i8

Source§

fn saturating_to_i16(&self) -> i16

Source§

fn saturating_to_i32(&self) -> i32

Source§

fn saturating_to_i64(&self) -> i64

Source§

fn saturating_to_i128(&self) -> i128

Source§

fn saturating_to_u8(&self) -> u8

Source§

fn saturating_to_u16(&self) -> u16

Source§

fn saturating_to_u32(&self) -> u32

Source§

fn saturating_to_u64(&self) -> u64

Source§

fn saturating_to_u128(&self) -> u128

Source§

fn saturating_to_f32(&self) -> f32

Source§

fn saturating_to_f64(&self) -> f64

Source§

fn binary_and(&self, other: &Value) -> Value

Source§

fn binary_or(&self, other: &Value) -> Value

Source§

fn binary_xor(&self, other: &Value) -> Value

Source§

fn binary_not(&self) -> Value

Source§

fn signed_abs(&self) -> Option<Value>

Source§

fn signed_signum(&self) -> Value

Source§

fn signed_is_positive(&self) -> bool

Source§

fn signed_is_negative(&self) -> bool

Source§

fn float_is_nan(&self) -> bool

Source§

fn float_is_infinite(&self) -> bool

Source§

fn float_is_finite(&self) -> bool

Source§

fn float_is_normal(&self) -> bool

Source§

fn float_is_subnormal(&self) -> bool

Source§

fn float_floor(&self) -> Value

Source§

fn float_ceil(&self) -> Value

Source§

fn float_round(&self) -> Value

Source§

fn float_trunc(&self) -> Value

Source§

fn float_fract(&self) -> Value

Source§

fn float_recip(&self) -> Value

Source§

fn float_pow(&self, n: &Value) -> Value

Source§

fn float_sqrt(&self) -> Value

Source§

fn float_exp(&self) -> Value

Source§

fn float_exp2(&self) -> Value

Source§

fn float_ln(&self) -> Value

Source§

fn float_log(&self, base: &Value) -> Value

Source§

fn float_log2(&self) -> Value

Source§

fn float_log10(&self) -> Value

Source§

fn float_cbrt(&self) -> Value

Source§

fn float_hypot(&self, n: &Value) -> Value

Source§

fn float_sin(&self) -> Value

Source§

fn float_cos(&self) -> Value

Source§

fn float_tan(&self) -> Value

Source§

fn float_asin(&self) -> Value

Source§

fn float_acos(&self) -> Value

Source§

fn float_atan(&self) -> Value

Source§

fn float_atan2(&self, n: &Value) -> Value

Source§

fn float_sinh(&self) -> Value

Source§

fn float_cosh(&self) -> Value

Source§

fn float_tanh(&self) -> Value

Source§

fn float_asinh(&self) -> Value

Source§

fn float_acosh(&self) -> Value

Source§

fn float_atanh(&self) -> Value

Source§

fn float_to_degrees(&self) -> Value

Source§

fn float_to_radians(&self) -> Value

Source§

fn partial_equality_eq(&self, other: &Value) -> bool

Source§

fn partial_equality_ne(&self, other: &Value) -> bool

Source§

fn partial_order_lt(&self, other: &Value) -> bool

Source§

fn partial_order_le(&self, other: &Value) -> bool

Source§

fn partial_order_gt(&self, other: &Value) -> bool

Source§

fn partial_order_ge(&self, other: &Value) -> bool

Source§

fn order_max(&self, other: &Value) -> Value

Source§

fn order_min(&self, other: &Value) -> Value

Source§

fn order_clamp(&self, min: &Value, max: &Value) -> Value

Source§

fn add(&self, other: &Value) -> Value

Source§

fn checked_add(&self, other: &Value) -> Option<Value>

Source§

fn saturating_add(&self, other: &Value) -> Value

Source§

fn wrapping_add(&self, other: &Value) -> Value

Source§

fn sub(&self, other: &Value) -> Value

Source§

fn checked_sub(&self, other: &Value) -> Option<Value>

Source§

fn saturating_sub(&self, other: &Value) -> Value

Source§

fn wrapping_sub(&self, other: &Value) -> Value

Source§

fn mul(&self, other: &Value) -> Value

Source§

fn checked_mul(&self, other: &Value) -> Option<Value>

Source§

fn saturating_mul(&self, other: &Value) -> Value

Source§

fn wrapping_mul(&self, other: &Value) -> Value

Source§

fn div(&self, other: &Value) -> Value

Source§

fn checked_div(&self, other: &Value) -> Option<Value>

Source§

fn rem(&self, other: &Value) -> Value

Source§

fn checked_rem(&self, other: &Value) -> Option<Value>

Source§

fn neg(&self) -> Value

Source§

fn checked_neg(&self) -> Option<Value>

Source§

fn wrapping_neg(&self) -> Value

Source§

fn pow(&self, exp: &u32) -> Value

Source§

fn checked_pow(&self, exp: &u32) -> Option<Value>

Source§

fn euclid_div(&self, other: &Value) -> Value

Source§

fn euclid_rem(&self, other: &Value) -> Value

Source§

fn checked_euclid_div(&self, other: &Value) -> Option<Value>

Source§

fn checked_euclid_rem(&self, other: &Value) -> Option<Value>

Source§

fn hash(&self, state: &mut dyn Hasher)

Source§

fn serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

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

Source§

impl Debug for Value

Source§

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

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

impl Display for Value

Source§

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

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

impl From<()> for Value

Source§

fn from(value: ()) -> Value

Converts to this type from the input type.
Source§

impl From<Arc<dyn Data>> for Value

Source§

fn from(value: Arc<dyn Data>) -> Value

Converts to this type from the input type.
Source§

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

Source§

fn from(value: Option<T>) -> Value

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(value: String) -> Value

Converts to this type from the input type.
Source§

impl<T> From<Vec<T>> for Value
where T: Into<Value>,

Source§

fn from(value: Vec<T>) -> Value

Converts to this type from the input type.
Source§

impl From<bool> for Value

Source§

fn from(value: bool) -> Value

Converts to this type from the input type.
Source§

impl From<char> for Value

Source§

fn from(value: char) -> Value

Converts to this type from the input type.
Source§

impl From<f32> for Value

Source§

fn from(value: f32) -> Value

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(value: f64) -> Value

Converts to this type from the input type.
Source§

impl From<i128> for Value

Source§

fn from(value: i128) -> Value

Converts to this type from the input type.
Source§

impl From<i16> for Value

Source§

fn from(value: i16) -> Value

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(value: i32) -> Value

Converts to this type from the input type.
Source§

impl From<i64> for Value

Source§

fn from(value: i64) -> Value

Converts to this type from the input type.
Source§

impl From<i8> for Value

Source§

fn from(value: i8) -> Value

Converts to this type from the input type.
Source§

impl From<u128> for Value

Source§

fn from(value: u128) -> Value

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(value: u16) -> Value

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(value: u32) -> Value

Converts to this type from the input type.
Source§

impl From<u64> for Value

Source§

fn from(value: u64) -> Value

Converts to this type from the input type.
Source§

impl From<u8> for Value

Source§

fn from(value: u8) -> Value

Converts to this type from the input type.
Source§

impl GetData<()> for Value

Source§

impl GetData<Arc<dyn Data>> for Value

Source§

fn try_data(self) -> Result<Arc<dyn Data>, ()>

Source§

impl<T> GetData<Option<T>> for Value
where Value: GetData<T>,

Source§

fn try_data(self) -> Result<Option<T>, ()>

Source§

impl GetData<String> for Value

Source§

impl<T> GetData<Vec<T>> for Value
where Value: GetData<T>,

Source§

fn try_data(self) -> Result<Vec<T>, ()>

Source§

impl GetData<bool> for Value

Source§

impl GetData<char> for Value

Source§

impl GetData<f32> for Value

Source§

impl GetData<f64> for Value

Source§

impl GetData<i128> for Value

Source§

impl GetData<i16> for Value

Source§

impl GetData<i32> for Value

Source§

impl GetData<i64> for Value

Source§

impl GetData<i8> for Value

Source§

impl GetData<u128> for Value

Source§

impl GetData<u16> for Value

Source§

impl GetData<u32> for Value

Source§

impl GetData<u64> for Value

Source§

impl GetData<u8> for Value

Source§

impl PartialEq for Value

Source§

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

Source§

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Value

§

impl !RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl !UnwindSafe for Value

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> Display for T
where T: Display,

Source§

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

Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> PartialEquality for T
where T: PartialEq,

Source§

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

Source§

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

Source§

impl<T> Serialize for T
where T: Serialize,

Source§

fn serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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> ToString for T
where T: Display + ?Sized,

Source§

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

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.