1#ifndef WASMTIME_ARRAYREF_CLASS_HH
2#define WASMTIME_ARRAYREF_CLASS_HH
6#ifdef WASMTIME_FEATURE_GC
8#include <wasmtime/_store_class.hh>
26 WASMTIME_OWN_WRAPPER(
ArrayRefPre, wasmtime_array_ref_pre)
49 const Val &elem, uint32_t
len);
65 const Val &value)
const;
WASM_API_EXTERN wasmtime_array_ref_pre_t * wasmtime_array_ref_pre_new(wasmtime_context_t *context, const wasmtime_array_type_t *ty)
Create a new array pre-allocator.
WASM_API_EXTERN wasmtime_error_t * wasmtime_arrayref_len(wasmtime_context_t *context, const wasmtime_arrayref_t *arrayref, uint32_t *out)
Get the length of an array.
Representation of a WebAssembly anyref value.
Definition: _anyref_class.hh:21
Pre-allocated array layout for fast allocation of array instances.
Definition: _arrayref_class.hh:24
static ArrayRefPre create(Store::Context cx, const ArrayType &ty)
Create a new array pre-allocator.
Definition: _arrayref_class.hh:30
Representation of a WebAssembly arrayref value.
Definition: _arrayref_class.hh:43
static Result< ArrayRef > create(Store::Context cx, const ArrayRefPre &pre, const Val &elem, uint32_t len)
Allocate a new array with all elements set to the same value.
Result< Val > get(Store::Context cx, uint32_t index) const
Read an element from the array.
Result< std::monostate > set(Store::Context cx, uint32_t index, const Val &value) const
Set an element of the array.
AnyRef to_anyref() const
Upcast to anyref.
Result< uint32_t > len(Store::Context cx) const
Get the length of the array.
Definition: _arrayref_class.hh:52
EqRef to_eqref() const
Upcast to eqref.
Owned handle to a WebAssembly array type definition.
Definition: types/arrayref.hh:18
Representation of a WebAssembly eqref value.
Definition: _eqref_class.hh:28
Errors coming from Wasmtime.
Definition: error.hh:26
Fallible result type used for Wasmtime.
Definition: error.hh:70
An interior pointer into a Store.
Definition: _store_class.hh:65
const wasmtime_context_t * capi() const
Returns the underlying C API pointer.
Definition: _store_class.hh:183
Representation of a generic WebAssembly value.
Definition: _val_class.hh:53
Build-time defines for how the C API was built.
A WebAssembly arrayref value.
Definition: val.h:210