pub enum Value {
Show 18 variants
Int(i32),
Float(Fp),
String(String),
Bool(bool),
Unit,
Reference(Rc<RefCell<Value>>),
Option(Option<Box<Value>>),
Array(ResolvedArrayTypeRef, Vec<Value>),
Map(ResolvedMapTypeRef, SeqMap<Value, Value>),
Tuple(ResolvedTupleTypeRef, Vec<Value>),
Struct(ResolvedStructTypeRef, Vec<Value>, ResolvedType),
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
Reference(Rc<RefCell<Value>>)
Option(Option<Box<Value>>)
Array(ResolvedArrayTypeRef, Vec<Value>)
Map(ResolvedMapTypeRef, SeqMap<Value, Value>)
Tuple(ResolvedTupleTypeRef, Vec<Value>)
Struct(ResolvedStructTypeRef, Vec<Value>, ResolvedType)
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, is_mutable: bool, ) -> Result<Box<dyn Iterator<Item = Value>>, ValueError>
pub fn into_iter_pairs( self, is_mutable: bool, ) -> 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 downcast_rust_mut_or_not<T: RustType + 'static>( &self, ) -> Option<Rc<RefCell<Box<T>>>>
pub fn downcast_rust_mut<T: RustType + 'static>( &self, ) -> Option<Rc<RefCell<Box<T>>>>
pub fn new_rust_value<T: RustType + 'static>( rust_type_ref: ResolvedRustTypeRef, value: T, ) -> Self
pub fn unref(&self) -> 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