Skip to content

vihaco_abi::program::value

value

vihaco_abi::program::value

classTypesource

vihaco_abi::program::value::Type

Bases: Debug, Clone, Copy, StructuralPartialEq, PartialEq, AsRef<Type>, Display

Rust enum.

pub enum Type

Variants

NameTypeDescription
Undefined—
String—
Bool—
I64—
U32—
U64—
F64—
FunctionRef—
HeapRef—
source

classValuesource

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 Value

Variants

NameTypeDescription
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
source

methodcastsource

vihaco_abi::program::value::Value::cast

pub fn cast(&self, to: impl AsRef<Type>) -> Result<Value>

Parameters

NameTypeDescription
toimpl AsRef&lt;Type&gt;

Returns

Result<Value>

source

methodget_function_refsource

vihaco_abi::program::value::Value::get_function_ref

pub fn get_function_ref(&self) -> Result<u32>

Returns

Result<u32>

source

methodget_heap_refsource

vihaco_abi::program::value::Value::get_heap_ref

pub fn get_heap_ref(&self) -> Result<u32>

Returns

Result<u32>

source

methodis_undefinedsource

vihaco_abi::program::value::Value::is_undefined

pub fn is_undefined(&self) -> bool

Returns

bool

source

methodtype_ofsource

vihaco_abi::program::value::Value::type_of

pub fn type_of(&self) -> Type

Returns

Type

source