Wasmtime
anyref.h
Go to the documentation of this file.
1
7
#ifndef WASMTIME_ANYREF_H
8
#define WASMTIME_ANYREF_H
9
10
#ifdef WASMTIME_FEATURE_GC
11
12
#include <
wasmtime/val.h
>
13
14
#ifdef __cplusplus
15
extern
"C"
{
16
#endif
17
20
static
inline
void
wasmtime_anyref_set_null(
wasmtime_anyref_t
*ref) {
21
ref->
store_id
= 0;
22
}
23
29
static
inline
bool
wasmtime_anyref_is_null(
const
wasmtime_anyref_t
*ref) {
30
return
ref->
store_id
== 0;
31
}
32
40
WASM_API_EXTERN
void
wasmtime_anyref_clone(
const
wasmtime_anyref_t
*anyref,
41
wasmtime_anyref_t
*out);
42
56
WASM_API_EXTERN
void
wasmtime_anyref_unroot(
wasmtime_anyref_t
*ref);
57
65
WASM_API_EXTERN
void
wasmtime_anyref_from_raw(
wasmtime_context_t
*context,
66
uint32_t raw,
67
wasmtime_anyref_t
*out);
68
79
WASM_API_EXTERN uint32_t wasmtime_anyref_to_raw(
wasmtime_context_t
*context,
80
const
wasmtime_anyref_t
*ref);
81
90
WASM_API_EXTERN
void
wasmtime_anyref_from_i31(
wasmtime_context_t
*context,
91
uint32_t i31val,
92
wasmtime_anyref_t
*out);
93
100
WASM_API_EXTERN
bool
wasmtime_anyref_is_i31(
wasmtime_context_t
*context,
101
const
wasmtime_anyref_t
*anyref);
102
112
WASM_API_EXTERN
bool
wasmtime_anyref_i31_get_u(
wasmtime_context_t
*context,
113
const
wasmtime_anyref_t
*anyref,
114
uint32_t *dst);
115
125
WASM_API_EXTERN
bool
wasmtime_anyref_i31_get_s(
wasmtime_context_t
*context,
126
const
wasmtime_anyref_t
*anyref,
127
int32_t *dst);
128
134
WASM_API_EXTERN
bool
wasmtime_anyref_is_eqref(
wasmtime_context_t
*context,
135
const
wasmtime_anyref_t
*anyref);
136
143
WASM_API_EXTERN
bool
wasmtime_anyref_as_eqref(
wasmtime_context_t
*context,
144
const
wasmtime_anyref_t
*anyref,
145
wasmtime_eqref_t
*out);
146
152
WASM_API_EXTERN
bool
wasmtime_anyref_is_struct(
wasmtime_context_t
*context,
153
const
wasmtime_anyref_t
*anyref);
154
161
WASM_API_EXTERN
bool
wasmtime_anyref_as_struct(
wasmtime_context_t
*context,
162
const
wasmtime_anyref_t
*anyref,
163
wasmtime_structref_t
*out);
164
170
WASM_API_EXTERN
bool
wasmtime_anyref_is_array(
wasmtime_context_t
*context,
171
const
wasmtime_anyref_t
*anyref);
172
179
WASM_API_EXTERN
bool
wasmtime_anyref_as_array(
wasmtime_context_t
*context,
180
const
wasmtime_anyref_t
*anyref,
181
wasmtime_arrayref_t
*out);
182
183
#ifdef __cplusplus
184
}
// extern "C"
185
#endif
186
187
#endif
// WASMTIME_FEATURE_GC
188
189
#endif
// WASMTIME_ANYREF_H
wasmtime_anyref
A WebAssembly value in the any hierarchy of GC types.
Definition:
val.h:77
wasmtime_anyref::store_id
uint64_t store_id
Definition:
val.h:80
wasmtime_arrayref
A WebAssembly arrayref value.
Definition:
val.h:210
wasmtime_context
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
wasmtime_eqref
A WebAssembly eqref value.
Definition:
val.h:163
wasmtime_structref
A WebAssembly structref value.
Definition:
val.h:187
val.h
include
wasmtime
anyref.h
Generated by
1.9.3