Wasmtime
instance.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_INSTANCE_H
8#define WASMTIME_INSTANCE_H
9
10#include <wasm.h>
11#include <wasmtime/extern.h>
12#include <wasmtime/module.h>
13#include <wasmtime/store.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
26typedef struct wasmtime_instance {
28 uint64_t store_id;
30 size_t index;
32
66 wasmtime_context_t *store,
67 const wasmtime_module_t *module,
68 const wasmtime_extern_t* imports,
69 size_t nimports,
70 wasmtime_instance_t *instance,
71 wasm_trap_t **trap
72);
73
89WASM_API_EXTERN bool wasmtime_instance_export_get(
90 wasmtime_context_t *store,
91 const wasmtime_instance_t *instance,
92 const char *name,
93 size_t name_len,
95);
96
115WASM_API_EXTERN bool wasmtime_instance_export_nth(
116 wasmtime_context_t *store,
117 const wasmtime_instance_t *instance,
118 size_t index,
119 char **name,
120 size_t *name_len,
122);
123
124#ifdef __cplusplus
125} // extern "C"
126#endif
127
128#endif // WASMTIME_INSTANCE_H
Definition of wasmtime_extern_t and external items.
bool wasmtime_instance_export_get(wasmtime_context_t *store, const wasmtime_instance_t *instance, const char *name, size_t name_len, wasmtime_extern_t *item)
Get an export by name from an instance.
bool wasmtime_instance_export_nth(wasmtime_context_t *store, const wasmtime_instance_t *instance, size_t index, char **name, size_t *name_len, wasmtime_extern_t *item)
Get an export by index from an instance.
struct wasmtime_instance wasmtime_instance_t
Representation of a instance in Wasmtime.
wasmtime_error_t * wasmtime_instance_new(wasmtime_context_t *store, const wasmtime_module_t *module, const wasmtime_extern_t *imports, size_t nimports, wasmtime_instance_t *instance, wasm_trap_t **trap)
Instantiate a wasm module.
Opaque struct representing a wasm trap.
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
Errors generated by Wasmtime.
Container for different kinds of extern items.
Definition: extern.h:123
Representation of a instance in Wasmtime.
Definition: instance.h:26
size_t index
Internal index within the store.
Definition: instance.h:30
uint64_t store_id
Internal identifier of what store this belongs to, never zero.
Definition: instance.h:28
A compiled Wasmtime module.