Wasmtime
component/component.h
1#ifndef WASMTIME_COMPONENT_COMPONENT_H
2#define WASMTIME_COMPONENT_COMPONENT_H
3
4#include <wasm.h>
5#include <wasmtime/conf.h>
6#include <wasmtime/error.h>
7
8#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
15typedef struct wasmtime_component_t wasmtime_component_t;
16
17#ifdef WASMTIME_FEATURE_COMPILER
18
39WASM_API_EXTERN wasmtime_error_t *
40wasmtime_component_new(const wasm_engine_t *engine, const uint8_t *buf,
41 size_t len, wasmtime_component_t **component_out);
42
56WASM_API_EXTERN wasmtime_error_t *
57wasmtime_component_serialize(const wasmtime_component_t *component,
58 wasm_byte_vec_t *ret);
59
60#endif // WASMTIME_FEATURE_COMPILER
61
72WASM_API_EXTERN wasmtime_error_t *
73wasmtime_component_deserialize(const wasm_engine_t *engine, const uint8_t *buf,
74 size_t len,
75 wasmtime_component_t **component_out);
76
91WASM_API_EXTERN wasmtime_error_t *
92wasmtime_component_deserialize_file(const wasm_engine_t *engine,
93 const char *path,
94 wasmtime_component_t **component_out);
95
100WASM_API_EXTERN wasmtime_component_t *
101wasmtime_component_clone(const wasmtime_component_t *component);
102
109WASM_API_EXTERN void wasmtime_component_delete(wasmtime_component_t *component);
110
111typedef struct wasmtime_component_export_index_t
112 wasmtime_component_export_index_t;
113
124WASM_API_EXTERN wasmtime_component_export_index_t *
125wasmtime_component_get_export_index(
126 const wasmtime_component_t *component,
127 const wasmtime_component_export_index_t *instance_export_index,
128 const char *name, size_t name_len);
129
135WASM_API_EXTERN void wasmtime_component_export_index_delete(
136 wasmtime_component_export_index_t *export_index);
137
138#ifdef __cplusplus
139} // extern "C"
140#endif
141
142#endif // WASMTIME_FEATURE_COMPONENT_MODEL
143
144#endif // WASMTIME_COMPONENT_COMPONENT_H
Build-time defines for how the C API was built.
Definition and accessors of wasmtime_error_t.
A list of bytes.
Definition: wasm.h:102
Compilation environment and configuration.
Errors generated by Wasmtime.