pub enum Value {
Show 16 variants
Int(i32),
Float(Fp),
String(String),
Bool(bool),
Unit,
Reference(Rc<RefCell<Value>>),
Array(Rc<ResolvedArrayType>, Vec<Value>),
Tuple(Rc<ResolvedTupleType>, Vec<Value>),
Struct(Rc<RefCell<ResolvedStructType>>, Vec<Value>, ResolvedType),
EnumVariantSimple(Rc<ResolvedEnumVariantType>),
EnumVariantTuple(Rc<ResolvedEnumVariantTupleType>, Vec<Value>),
EnumVariantStruct(Rc<ResolvedEnumVariantStructType>, Vec<Value>),
ExclusiveRange(Box<i32>, Box<i32>),
InternalFunction(Rc<ResolvedInternalFunctionDefinition>),
ExternalFunction(u32),
RustValue(Rc<RefCell<Box<dyn RustType>>>),
}
Variants§
Int(i32)
Float(Fp)
String(String)
Bool(bool)
Unit
Reference(Rc<RefCell<Value>>)
Array(Rc<ResolvedArrayType>, Vec<Value>)
Tuple(Rc<ResolvedTupleType>, Vec<Value>)
Struct(Rc<RefCell<ResolvedStructType>>, Vec<Value>, ResolvedType)
EnumVariantSimple(Rc<ResolvedEnumVariantType>)
EnumVariantTuple(Rc<ResolvedEnumVariantTupleType>, Vec<Value>)
EnumVariantStruct(Rc<ResolvedEnumVariantStructType>, Vec<Value>)
ExclusiveRange(Box<i32>, Box<i32>)
InternalFunction(Rc<ResolvedInternalFunctionDefinition>)
ExternalFunction(u32)
RustValue(Rc<RefCell<Box<dyn RustType>>>)
Implementations§
Source§impl Value
impl Value
pub fn expect_string(&self) -> Result<&str, ConversionError>
pub fn expect_int(&self) -> Result<i32, ConversionError>
pub fn as_bool(&self) -> Result<bool, String>
pub fn downcast_rust<T>(&self) -> Option<Rc<RefCell<Box<T>>>>where
T: RustType + 'static,
pub fn new_rust_value<T>(value: T) -> Valuewhere
T: RustType + 'static,
Trait Implementations§
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