pub enum Value {
None,
Bool(bool),
Number(Number),
String(String),
List(Vec<Value>),
Map(IndexMap<Value, Value>),
Range(ValueRange),
Error(VMError),
Tuple(Vec<Value>),
Type(RigzType),
}
Variants§
None
Bool(bool)
Number(Number)
String(String)
List(Vec<Value>)
Map(IndexMap<Value, Value>)
Range(ValueRange)
Error(VMError)
Tuple(Vec<Value>)
Type(RigzType)
Implementations§
Source§impl Value
impl Value
pub fn to_number(&self) -> Result<Number, VMError>
pub fn to_float(&self) -> Result<f64, VMError>
pub fn to_int(&self) -> Result<i64, VMError>
pub fn to_usize(&self) -> Result<usize, VMError>
pub fn as_bool(&mut self) -> &mut bool
pub fn as_float(&mut self) -> Result<&mut f64, VMError>
pub fn as_number(&mut self) -> Result<&mut Number, VMError>
pub fn as_int(&mut self) -> Result<&mut i64, VMError>
pub fn as_string(&mut self) -> &mut String
pub fn as_map(&mut self) -> &mut IndexMap<Value, Value>
pub fn as_list(&mut self) -> &mut Vec<Value>
pub fn to_bool(&self) -> bool
pub fn to_list(&self) -> Vec<Value>
pub fn to_map(&self) -> IndexMap<Value, Value>
pub fn rigz_type(&self) -> RigzType
pub fn cast(&self, rigz_type: &RigzType) -> Value
pub fn get(&self, attr: &Value) -> Result<Option<Value>, VMError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Value, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Value, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<A, B, C, D> From<(A, B, C, D)> for Value
impl<A, B, C, D> From<(A, B, C, D)> for Value
Source§fn from(value: (A, B, C, D)) -> Value
fn from(value: (A, B, C, D)) -> Value
Converts to this type from the input type.
Source§impl<A, B, C, D, E> From<(A, B, C, D, E)> for Value
impl<A, B, C, D, E> From<(A, B, C, D, E)> for Value
Source§fn from(value: (A, B, C, D, E)) -> Value
fn from(value: (A, B, C, D, E)) -> Value
Converts to this type from the input type.
Source§impl From<ValueRange> for Value
impl From<ValueRange> for Value
Source§fn from(value: ValueRange) -> Value
fn from(value: ValueRange) -> Value
Converts to this type from the input type.
Source§impl Logical<&Value> for &Value
impl Logical<&Value> for &Value
type Output = Value
fn and(self, rhs: &Value) -> <&Value as Logical<&Value>>::Output
fn or(self, rhs: &Value) -> <&Value as Logical<&Value>>::Output
fn xor(self, rhs: &Value) -> <&Value as Logical<&Value>>::Output
fn elvis(self, rhs: &Value) -> <&Value as Logical<&Value>>::Output
Source§impl PartialOrd for Value
impl PartialOrd for Value
Source§impl Serialize for Value
impl Serialize for Value
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl Eq for Value
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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more