pub enum Value {
Show 18 variants
Int(i32),
Float(Fp),
String(String),
Bool(bool),
Unit,
Option(Option<ValueRef>),
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>),
InclusiveRange(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<ValueRef>)
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>)
InclusiveRange(Box<i32>, Box<i32>)
InternalFunction(ResolvedInternalFunctionDefinitionRef)
ExternalFunction(ExternalFunctionId)
RustValue(ResolvedRustTypeRef, Rc<RefCell<Box<dyn RustType>>>)
Implementations§
Source§impl Value
impl Value
Sourcepub fn quick_serialize(&self, octets: &mut [u8], depth: usize) -> usize
pub fn quick_serialize(&self, octets: &mut [u8], depth: usize) -> usize
Serialize as quickly as possible Endian format is undefined. It is only used for serializing during a running application
Source§impl Value
impl Value
Sourcepub fn into_iter_pairs(
self,
) -> Result<Box<dyn Iterator<Item = (Self, Self)>>, ValueError>
pub fn into_iter_pairs( self, ) -> Result<Box<dyn Iterator<Item = (Self, Self)>>, ValueError>
pub fn convert_to_string_if_needed(&self) -> String
Sourcepub fn expect_string(&self) -> Result<String, ValueError>
pub fn expect_string(&self) -> Result<String, ValueError>
§Errors
Sourcepub fn expect_int(&self) -> Result<i32, ValueError>
pub fn expect_int(&self) -> Result<i32, ValueError>
§Errors
Sourcepub fn expect_float(&self) -> Result<Fp, ValueError>
pub fn expect_float(&self) -> Result<Fp, ValueError>
§Errors
pub fn new_rust_value<T: RustType + 'static + PartialEq>( 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