Skip to content

vihaco_abi (crate)

vihaco_abi

vihaco_abi

Modules

classEffectssource

vihaco_abi::Effects

Bases: Debug, Clone, StructuralPartialEq, PartialEq, Eq, From<Option<T>>, From<Vec<T>>, From<SmallVec<[T; 2]>>, IntoIterator

Rust enum.

pub enum Effects<T>

Variants

NameTypeDescription
None—
One(T)
Many(SmallVec&lt;[T; 2]&gt;)
source

methodappendsource

vihaco_abi::Effects::append

pub fn append(self, effect: T) -> Self

Parameters

NameTypeDescription
effectT

Returns

Self

source

methodextendsource

vihaco_abi::Effects::extend

pub fn extend(self, other: Self) -> Self

Parameters

NameTypeDescription
otherSelf

Returns

Self

source

methodflat_mapsource

vihaco_abi::Effects::flat_map

pub fn flat_map<U>(self, f: impl FnMut(T) -> Effects<U>) -> Effects<U>

Parameters

NameTypeDescription
fimpl FnMut(T) -&gt; Effects&lt;U&gt;

Returns

Effects<U>

source

methodmanysource

vihaco_abi::Effects::many

pub fn many(values: SmallVec<[T; 2]>) -> Self

Parameters

NameTypeDescription
valuesSmallVec&lt;[T; 2]&gt;

Returns

Self

source

methodmapsource

vihaco_abi::Effects::map

pub fn map<U>(self, f: impl FnMut(T) -> U) -> Effects<U>

Parameters

NameTypeDescription
fimpl FnMut(T) -&gt; U

Returns

Effects<U>

source

methodnonesource

vihaco_abi::Effects::none

pub fn none() -> Self

Returns

Self

source

methodonesource

vihaco_abi::Effects::one

pub fn one(value: T) -> Self

Parameters

NameTypeDescription
valueT

Returns

Self

source

classTypesource

vihaco_abi::Type

Bases: Debug, Clone, Copy, StructuralPartialEq, PartialEq, AsRef&lt;Type&gt;, Display

Rust enum.

pub enum Type

Variants

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

classValuesource

vihaco_abi::Value

Bases: Debug, Clone, Copy, StructuralPartialEq, PartialEq, Display, From&lt;bool&gt;, From&lt;i64&gt;, From&lt;u32&gt;, From&lt;u64&gt;, From&lt;f64&gt;, TryFrom&lt;Value&gt;

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::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::Value::get_function_ref

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

Returns

Result<u32>

source

methodget_heap_refsource

vihaco_abi::Value::get_heap_ref

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

Returns

Result<u32>

source

methodis_undefinedsource

vihaco_abi::Value::is_undefined

pub fn is_undefined(&self) -> bool

Returns

bool

source

methodtype_ofsource

vihaco_abi::Value::type_of

pub fn type_of(&self) -> Type

Returns

Type

source