Wasmtime
module.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_MODULE_H
8#define WASMTIME_MODULE_H
9
10#include <wasm.h>
11#include <wasmtime/error.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
29
45 const uint8_t *wasm,
46 size_t wasm_len,
47 wasmtime_module_t **ret);
48
53
59
63WASM_API_EXTERN void wasmtime_module_imports(const wasmtime_module_t *module,
65
69WASM_API_EXTERN void wasmtime_module_exports(const wasmtime_module_t *module,
71
84WASM_API_EXTERN wasmtime_error_t *
85wasmtime_module_validate(wasm_engine_t *engine, const uint8_t *wasm,
86 size_t wasm_len);
87
101WASM_API_EXTERN wasmtime_error_t *
103
114WASM_API_EXTERN wasmtime_error_t *
115wasmtime_module_deserialize(wasm_engine_t *engine, const uint8_t *bytes,
116 size_t bytes_len, wasmtime_module_t **ret);
117
132WASM_API_EXTERN wasmtime_error_t *
134 wasmtime_module_t **ret);
135
147WASM_API_EXTERN void
149 void **end);
150
151#ifdef __cplusplus
152} // extern "C"
153#endif
154
155#endif // WASMTIME_MODULE_H
Definition and accessors of wasmtime_error_t.
void wasmtime_module_image_range(const wasmtime_module_t *module, void **start, void **end)
Returns the range of bytes in memory where this module’s compilation image resides.
wasmtime_error_t * wasmtime_module_serialize(wasmtime_module_t *module, wasm_byte_vec_t *ret)
This function serializes compiled module artifacts as blob data.
void wasmtime_module_imports(const wasmtime_module_t *module, wasm_importtype_vec_t *out)
Same as wasm_module_imports, but for wasmtime_module_t.
wasmtime_error_t * wasmtime_module_deserialize(wasm_engine_t *engine, const uint8_t *bytes, size_t bytes_len, wasmtime_module_t **ret)
Build a module from serialized data.
wasmtime_module_t * wasmtime_module_clone(wasmtime_module_t *m)
Creates a shallow clone of the specified module, increasing the internal reference count.
wasmtime_error_t * wasmtime_module_deserialize_file(wasm_engine_t *engine, const char *path, wasmtime_module_t **ret)
Deserialize a module from an on-disk file.
wasmtime_error_t * wasmtime_module_validate(wasm_engine_t *engine, const uint8_t *wasm, size_t wasm_len)
Validate a WebAssembly binary.
wasmtime_error_t * wasmtime_module_new(wasm_engine_t *engine, const uint8_t *wasm, size_t wasm_len, wasmtime_module_t **ret)
Compiles a WebAssembly binary into a wasmtime_module_t.
void wasmtime_module_exports(const wasmtime_module_t *module, wasm_exporttype_vec_t *out)
Same as wasm_module_exports, but for wasmtime_module_t.
void wasmtime_module_delete(wasmtime_module_t *m)
Deletes a module.
A list of bytes.
Definition: wasm.h:102
Compilation environment and configuration.
A list of wasm_exporttype_t values.
Definition: wasm.h:305
A list of wasm_importtype_t values.
Definition: wasm.h:293
Errors generated by Wasmtime.
A compiled Wasmtime module.