vihaco_abi::program::value
value¶
vihaco_abi::program::value
classType¶source
vihaco_abi::program::value::Type
Bases: Debug, Clone, Copy, StructuralPartialEq, PartialEq, AsRef<Type>, Display
Rust enum.
pub enum TypeVariants
| Name | Type | Description |
|---|---|---|
Undefined | — | |
String | — | |
Bool | — | |
I64 | — | |
U32 | — | |
U64 | — | |
F64 | — | |
FunctionRef | — | |
HeapRef | — |
classValue¶source
vihaco_abi::program::value::Value
Bases: Debug, Clone, Copy, StructuralPartialEq, PartialEq, Display, From<bool>, From<i64>, From<u32>, From<u64>, From<f64>, TryFrom<Value>
Rust enum.
pub enum ValueVariants
| Name | Type | Description |
|---|---|---|
Undefined | — | |
String | (u32) | a string value from the string interner |
Bool | (bool) | a boolean value |
I64 | (i64) | a signed 64-bit integer |
U32 | (u32) | an unsigned 32-bit integer |
U64 | (u64) | an unsigned 64-bit integer |
F64 | (f64) | a 64-bit floating point number |
FunctionRef | (u32) | a reference to a function by its index in the function table |
HeapRef | (u32) | a reference to an immutable heap object by its index in the heap table |
methodcast¶source
vihaco_abi::program::value::Value::cast
pub fn cast(&self, to: impl AsRef<Type>) -> Result<Value>Parameters
| Name | Type | Description |
|---|---|---|
to | impl AsRef<Type> |
Returns
Result<Value>
methodget_function_ref¶source
vihaco_abi::program::value::Value::get_function_ref
methodget_heap_ref¶source
vihaco_abi::program::value::Value::get_heap_ref
methodis_undefined¶source
vihaco_abi::program::value::Value::is_undefined
methodtype_of¶source
vihaco_abi::program::value::Value::type_of