pub enum Value {
Show 21 variants
Int(i32),
Float(Fp),
String(String),
Bool(bool),
Unit,
Slice(Type, Vec<ValueRef>),
SlicePair(Type, SeqMap<Value, ValueRef>),
Option(Option<ValueRef>),
Vec(Type, Vec<ValueRef>),
Map(Type, SeqMap<Value, ValueRef>),
Tuple(Vec<Type>, Vec<ValueRef>),
Sparse(Type, SparseValueMap),
NamedStruct(NamedStructType, Vec<ValueRef>),
AnonymousStruct(AnonymousStructType, Vec<ValueRef>),
EnumVariantSimple(EnumVariantSimpleType),
EnumVariantTuple(EnumVariantTupleType, Vec<ValueRef>),
EnumVariantStruct(EnumVariantStructType, Vec<ValueRef>),
Range(Box<i32>, Box<i32>, RangeMode),
InternalFunction(InternalFunctionDefinitionRef),
ExternalFunction(ExternalFunctionDefinitionRef),
RustValue(ExternalType, Rc<RefCell<Box<dyn RustType>>>),
}
Variants§
Int(i32)
Float(Fp)
String(String)
Bool(bool)
Unit
Slice(Type, Vec<ValueRef>)
SlicePair(Type, SeqMap<Value, ValueRef>)
Option(Option<ValueRef>)
Vec(Type, Vec<ValueRef>)
Map(Type, SeqMap<Value, ValueRef>)
Tuple(Vec<Type>, Vec<ValueRef>)
Sparse(Type, SparseValueMap)
NamedStruct(NamedStructType, Vec<ValueRef>)
AnonymousStruct(AnonymousStructType, Vec<ValueRef>)
EnumVariantSimple(EnumVariantSimpleType)
EnumVariantTuple(EnumVariantTupleType, Vec<ValueRef>)
EnumVariantStruct(EnumVariantStructType, Vec<ValueRef>)
Range(Box<i32>, Box<i32>, RangeMode)
InternalFunction(InternalFunctionDefinitionRef)
ExternalFunction(ExternalFunctionDefinitionRef)
RustValue(ExternalType, 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
pub fn expect_struct( &self, ) -> Result<(NamedStructType, &Vec<ValueRef>), ValueError>
pub fn expect_anon_struct( &self, ) -> Result<(AnonymousStructType, &Vec<ValueRef>), ValueError>
pub fn expect_array(&self) -> Result<(Type, &Vec<ValueRef>), ValueError>
pub fn expect_map(&self) -> Result<(Type, &SeqMap<Value, ValueRef>), ValueError>
pub fn expect_map_mut( &mut self, ) -> Result<(Type, &mut SeqMap<Value, ValueRef>), ValueError>
Sourcepub fn expect_int(&self) -> Result<i32, ValueError>
pub fn expect_int(&self) -> Result<i32, ValueError>
§Errors
Sourcepub fn expect_bool(&self) -> Result<bool, ValueError>
pub fn expect_bool(&self) -> Result<bool, ValueError>
§Errors
Sourcepub fn expect_slice(&self) -> Result<(Type, Vec<ValueRef>), ValueError>
pub fn expect_slice(&self) -> Result<(Type, Vec<ValueRef>), ValueError>
§Errors
Sourcepub fn expect_slice_pair(
&self,
) -> Result<(Type, &SeqMap<Value, ValueRef>), ValueError>
pub fn expect_slice_pair( &self, ) -> Result<(Type, &SeqMap<Value, ValueRef>), 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: ExternalType, 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