Wasmtime
component/component.h
Go to the documentation of this file.
1
2
3#ifndef WASMTIME_COMPONENT_COMPONENT_H
4#define WASMTIME_COMPONENT_COMPONENT_H
5
6#include <wasm.h>
7#include <wasmtime/conf.h>
8#include <wasmtime/error.h>
9
10#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
18
19#ifdef WASMTIME_FEATURE_COMPILER
20
41WASM_API_EXTERN wasmtime_error_t *
42wasmtime_component_new(const wasm_engine_t *engine, const uint8_t *buf,
43 size_t len, wasmtime_component_t **component_out);
44
58WASM_API_EXTERN wasmtime_error_t *
60 wasm_byte_vec_t *ret);
61
62#endif // WASMTIME_FEATURE_COMPILER
63
74WASM_API_EXTERN wasmtime_error_t *
75wasmtime_component_deserialize(const wasm_engine_t *engine, const uint8_t *buf,
76 size_t len,
77 wasmtime_component_t **component_out);
78
93WASM_API_EXTERN wasmtime_error_t *
95 const char *path,
96 wasmtime_component_t **component_out);
97
102WASM_API_EXTERN wasmtime_component_t *
104
110WASM_API_EXTERN void wasmtime_component_delete(wasmtime_component_t *component);
111
115
126WASM_API_EXTERN wasmtime_component_export_index_t *
128 const wasmtime_component_t *component,
129 const wasmtime_component_export_index_t *instance_export_index,
130 const char *name, size_t name_len);
131
139
140#ifdef __cplusplus
141} // extern "C"
142#endif
143
144#endif // WASMTIME_FEATURE_COMPONENT_MODEL
145
146#endif // WASMTIME_COMPONENT_COMPONENT_H
wasmtime_error_t * wasmtime_component_deserialize(const wasm_engine_t *engine, const uint8_t *buf, size_t len, wasmtime_component_t **component_out)
Build a component from serialized data.
wasmtime_component_t * wasmtime_component_clone(const wasmtime_component_t *component)
Creates a shallow clone of the specified component, increasing the internal reference count.
struct wasmtime_component_export_index_t wasmtime_component_export_index_t
A value which represents a known export of a component.
Definition: component/component.h:113
struct wasmtime_component_t wasmtime_component_t
Representation of a component in the component model.
Definition: component/component.h:17
wasmtime_component_export_index_t * wasmtime_component_get_export_index(const wasmtime_component_t *component, const wasmtime_component_export_index_t *instance_export_index, const char *name, size_t name_len)
Looks up a specific export of this component by name optionally nested within the instance provided.
wasmtime_error_t * wasmtime_component_new(const wasm_engine_t *engine, const uint8_t *buf, size_t len, wasmtime_component_t **component_out)
Compiles a WebAssembly binary into a wasmtime_component_t.
wasmtime_error_t * wasmtime_component_serialize(const wasmtime_component_t *component, wasm_byte_vec_t *ret)
This function serializes compiled component artifacts as blob data.
void wasmtime_component_delete(wasmtime_component_t *component)
Deletes a wasmtime_component_t created by wasmtime_component_new.
void wasmtime_component_export_index_delete(wasmtime_component_export_index_t *export_index)
Deletes a wasmtime_component_export_index_t.
wasmtime_error_t * wasmtime_component_deserialize_file(const wasm_engine_t *engine, const char *path, wasmtime_component_t **component_out)
Deserialize a component from an on-disk file.
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.