7#ifndef WASMTIME_STRUCTREF_H
8#define WASMTIME_STRUCTREF_H
12#ifdef WASMTIME_FEATURE_GC
Build-time defines for how the C API was built.
WASM_API_EXTERN wasmtime_error_t * wasmtime_structref_set_field(wasmtime_context_t *context, const wasmtime_structref_t *structref, size_t index, const wasmtime_val_t *val)
Set a field of a struct.
WASM_API_EXTERN void wasmtime_structref_clone(const wasmtime_structref_t *structref, wasmtime_structref_t *out)
Clone a structref, creating a new root.
WASM_API_EXTERN void wasmtime_structref_unroot(wasmtime_structref_t *ref)
Unroot a structref to allow garbage collection.
WASM_API_EXTERN void wasmtime_structref_to_eqref(const wasmtime_structref_t *structref, wasmtime_eqref_t *out)
Upcast a structref to an eqref.
struct wasmtime_struct_ref_pre wasmtime_struct_ref_pre_t
An opaque, pre-allocated, and registered struct layout for faster allocation.
Definition: structref.h:30
WASM_API_EXTERN wasmtime_error_t * wasmtime_structref_field(wasmtime_context_t *context, const wasmtime_structref_t *structref, size_t index, wasmtime_val_t *out)
Read a field from a struct.
WASM_API_EXTERN void wasmtime_struct_ref_pre_delete(wasmtime_struct_ref_pre_t *pre)
Delete a struct pre-allocator.
WASM_API_EXTERN wasmtime_error_t * wasmtime_structref_new(wasmtime_context_t *context, const wasmtime_struct_ref_pre_t *pre, const wasmtime_val_t *fields, size_t nfields, wasmtime_structref_t *out)
Allocate a new struct instance.
WASM_API_EXTERN void wasmtime_structref_to_anyref(const wasmtime_structref_t *structref, wasmtime_anyref_t *out)
Upcast a structref to an anyref.
WASM_API_EXTERN wasmtime_struct_ref_pre_t * wasmtime_struct_ref_pre_new(wasmtime_context_t *context, const wasmtime_struct_type_t *ty)
Create a new struct pre-allocator.
A WebAssembly value in the any hierarchy of GC types.
Definition: val.h:77
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
A WebAssembly eqref value.
Definition: val.h:163
Errors generated by Wasmtime.
A WebAssembly structref value.
Definition: val.h:187
uint64_t store_id
Internal metadata.
Definition: val.h:189
Container for different kinds of wasm values.
Definition: val.h:376
struct wasmtime_struct_type wasmtime_struct_type_t
An opaque handle to a WebAssembly struct type definition.
Definition: types/structref.h:58