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/types/val.h
>
13
#include <
wasmtime/val.h
>
14
15
#ifdef __cplusplus
16
extern
"C"
{
17
#endif
18
21
static
inline
void
wasmtime_anyref_set_null(
wasmtime_anyref_t
*ref) {
22
ref->
store_id
= 0;
23
}
24
30
static
inline
bool
wasmtime_anyref_is_null(
const
wasmtime_anyref_t
*ref) {
31
return
ref->
store_id
== 0;
32
}
33
41
WASM_API_EXTERN
void
wasmtime_anyref_clone(
const
wasmtime_anyref_t
*anyref,
42
wasmtime_anyref_t
*out);
43
57
WASM_API_EXTERN
void
wasmtime_anyref_unroot(
wasmtime_anyref_t
*ref);
58
66
WASM_API_EXTERN
void
wasmtime_anyref_from_raw(
wasmtime_context_t
*context,
67
uint32_t raw,
68
wasmtime_anyref_t
*out);
69
80
WASM_API_EXTERN uint32_t wasmtime_anyref_to_raw(
wasmtime_context_t
*context,
81
const
wasmtime_anyref_t
*ref);
82
91
WASM_API_EXTERN
void
wasmtime_anyref_from_i31(
wasmtime_context_t
*context,
92
uint32_t i31val,
93
wasmtime_anyref_t
*out);
94
101
WASM_API_EXTERN
bool
wasmtime_anyref_is_i31(
wasmtime_context_t
*context,
102
const
wasmtime_anyref_t
*anyref);
103
113
WASM_API_EXTERN
bool
wasmtime_anyref_i31_get_u(
wasmtime_context_t
*context,
114
const
wasmtime_anyref_t
*anyref,
115
uint32_t *dst);
116
126
WASM_API_EXTERN
bool
wasmtime_anyref_i31_get_s(
wasmtime_context_t
*context,
127
const
wasmtime_anyref_t
*anyref,
128
int32_t *dst);
129
135
WASM_API_EXTERN
bool
wasmtime_anyref_is_eqref(
wasmtime_context_t
*context,
136
const
wasmtime_anyref_t
*anyref);
137
144
WASM_API_EXTERN
bool
wasmtime_anyref_as_eqref(
wasmtime_context_t
*context,
145
const
wasmtime_anyref_t
*anyref,
146
wasmtime_eqref_t
*out);
147
153
WASM_API_EXTERN
bool
wasmtime_anyref_is_struct(
wasmtime_context_t
*context,
154
const
wasmtime_anyref_t
*anyref);
155
162
WASM_API_EXTERN
bool
wasmtime_anyref_as_struct(
wasmtime_context_t
*context,
163
const
wasmtime_anyref_t
*anyref,
164
wasmtime_structref_t
*out);
165
171
WASM_API_EXTERN
bool
wasmtime_anyref_is_array(
wasmtime_context_t
*context,
172
const
wasmtime_anyref_t
*anyref);
173
180
WASM_API_EXTERN
bool
wasmtime_anyref_as_array(
wasmtime_context_t
*context,
181
const
wasmtime_anyref_t
*anyref,
182
wasmtime_arrayref_t
*out);
183
191
WASM_API_EXTERN
bool
wasmtime_anyref_type(
wasmtime_context_t
*context,
192
const
wasmtime_anyref_t
*anyref,
193
wasmtime_heaptype_t
*out);
194
195
#ifdef __cplusplus
196
}
// extern "C"
197
#endif
198
199
#endif
// WASMTIME_FEATURE_GC
200
201
#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_heaptype
A WebAssembly heap type.
Definition:
types/val.h:76
wasmtime_structref
A WebAssembly structref value.
Definition:
val.h:187
val.h
val.h
include
wasmtime
anyref.h
Generated by
1.9.3