pub enum Value {
Show 17 variants
Int(i32),
Float(Fp),
String(String),
Bool(bool),
Unit,
Option(Option<Box<Value>>),
Array(ResolvedArrayTypeRef, Vec<ValueRef>),
Map(ResolvedMapTypeRef, SeqMap<Value, ValueRef>),
Tuple(ResolvedTupleTypeRef, Vec<ValueRef>),
Struct(ResolvedStructTypeRef, Vec<ValueRef>),
EnumVariantSimple(ResolvedEnumVariantTypeRef),
EnumVariantTuple(ResolvedEnumVariantTupleTypeRef, Vec<Value>),
EnumVariantStruct(ResolvedEnumVariantStructTypeRef, Vec<Value>),
ExclusiveRange(Box<i32>, Box<i32>),
InternalFunction(ResolvedInternalFunctionDefinitionRef),
ExternalFunction(ExternalFunctionId),
RustValue(ResolvedRustTypeRef, Rc<RefCell<Box<dyn RustType>>>),
}
Variants§
Int(i32)
Float(Fp)
String(String)
Bool(bool)
Unit
Option(Option<Box<Value>>)
Array(ResolvedArrayTypeRef, Vec<ValueRef>)
Map(ResolvedMapTypeRef, SeqMap<Value, ValueRef>)
Tuple(ResolvedTupleTypeRef, Vec<ValueRef>)
Struct(ResolvedStructTypeRef, Vec<ValueRef>)
EnumVariantSimple(ResolvedEnumVariantTypeRef)
EnumVariantTuple(ResolvedEnumVariantTupleTypeRef, Vec<Value>)
EnumVariantStruct(ResolvedEnumVariantStructTypeRef, Vec<Value>)
ExclusiveRange(Box<i32>, Box<i32>)
InternalFunction(ResolvedInternalFunctionDefinitionRef)
ExternalFunction(ExternalFunctionId)
RustValue(ResolvedRustTypeRef, Rc<RefCell<Box<dyn RustType>>>)
Implementations§
Source§impl Value
impl Value
pub fn into_iter(self) -> Result<Box<dyn Iterator<Item = Value>>, ValueError>
pub fn into_iter_pairs( self, ) -> Result<Box<dyn Iterator<Item = (Value, Value)>>, ValueError>
pub fn convert_to_string_if_needed(&self) -> String
pub fn expect_string(&self) -> Result<String, ValueError>
pub fn expect_int(&self) -> Result<i32, ValueError>
pub fn as_bool(&self) -> Result<bool, String>
pub fn is_truthy(&self) -> Result<bool, String>
pub fn downcast_rust<T: RustType + 'static>( &self, ) -> Option<Rc<RefCell<Box<T>>>>
pub fn new_rust_value<T: RustType + 'static>( rust_type_ref: ResolvedRustTypeRef, value: T, ) -> Self
Trait Implementations§
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