5#ifndef WASMTIME_COMPONENT_TYPES_INSTANCE_HH
6#define WASMTIME_COMPONENT_TYPES_INSTANCE_HH
10#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
17#include <wasmtime/helpers.hh>
29 wasmtime_component_instance_type);
32 size_t export_count(
const Engine &engine)
const {
40 std::optional<ComponentExtern> export_get(
const Engine &engine,
41 std::string_view name)
const;
47 std::optional<std::pair<std::string_view, ComponentExtern>>
48 export_nth(
const Engine &engine,
size_t nth)
const;
56inline std::optional<wasmtime::component::ComponentExtern>
57wasmtime::component::ComponentInstanceType::export_get(
61 capi(), engine.capi(), name.data(), name.size(), &e);
69 std::pair<std::string_view, wasmtime::component::ComponentExtern>>
70wasmtime::component::ComponentInstanceType::export_nth(
73 const char *name_data;
76 capi(), engine.capi(), nth, &name_data, &name_size, &e);
80 return std::make_pair(std::string_view(name_data, name_size),
Global compilation state in Wasmtime.
Definition: engine.hh:22
Full description of a single import or export of a component or a component instance.
Definition: component/types/component.hh:198
Represents the type of a component instance.
Definition: component/types/instance.hh:27
struct wasmtime_component_extern_t wasmtime_component_extern_t
Full description of a single component or component instance export or import.
Definition: component/types/component.h:166
WASM_API_EXTERN bool wasmtime_component_instance_type_export_nth(const wasmtime_component_instance_type_t *ty, const wasm_engine_t *engine, size_t nth, const char **name_ret, size_t *name_len_ret, struct wasmtime_component_extern_t **ret)
Retrieves the nth export.
WASM_API_EXTERN bool wasmtime_component_instance_type_export_get(const wasmtime_component_instance_type_t *ty, const wasm_engine_t *engine, const char *name, size_t name_len, struct wasmtime_component_extern_t **ret)
Retrieves the export with the specified name.
WASM_API_EXTERN size_t wasmtime_component_instance_type_export_count(const wasmtime_component_instance_type_t *ty, const wasm_engine_t *engine)
Returns the number of exports of a component instance type.
Build-time defines for how the C API was built.