3#ifndef WASMTIME_COMPONENT_INSTANCE_HH
4#define WASMTIME_COMPONENT_INSTANCE_HH
8#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
39 std::string_view name)
const {
42 &this->instance, cx.
capi(), instance ? instance->
capi() :
nullptr,
43 name.data(), name.size());
An interior pointer into a Store.
Definition: store.hh:60
const wasmtime_context_t * capi() const
Returns the underlying C API pointer.
Definition: store.hh:154
An index to an exported item within a particular component.
Definition: component/component.hh:31
const wasmtime_component_export_index_t * capi() const
Returns the underlying C API pointer.
Definition: component/component.hh:62
Class representing an instantiated WebAssembly component.
Definition: component/func.hh:23
Class representing an instantiated WebAssembly component.
Definition: component/instance.hh:22
std::optional< Func > get_func(Store::Context cx, const ExportIndex &index) const
Looks up an exported function by its export index.
Definition: component/instance.hh:51
std::optional< ExportIndex > get_export_index(Store::Context cx, const ExportIndex *instance, std::string_view name) const
Looks up an exported item from this instance by name, returning the index at which it can be found.
Definition: component/instance.hh:37
Instance(const wasmtime_component_instance_t &inst)
Constructs an Instance from the underlying C API struct.
Definition: component/instance.hh:27
const wasmtime_component_instance_t * capi() const
Returns the underlying C API pointer.
Definition: component/instance.hh:62
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
wasmtime_component_export_index_t * wasmtime_component_instance_get_export_index(const wasmtime_component_instance_t *instance, wasmtime_context_t *context, const wasmtime_component_export_index_t *instance_export_index, const char *name, size_t name_len)
A methods similar to wasmtime_component_get_export_index except for this instance.
bool wasmtime_component_instance_get_func(const wasmtime_component_instance_t *instance, wasmtime_context_t *context, const wasmtime_component_export_index_t *export_index, wasmtime_component_func_t *func_out)
Looks up an exported function by name within this wasmtime_component_instance_t.
Build-time defines for how the C API was built.
Representation of a function in Wasmtime.
Definition: component/func.h:24
Representation of a instance in Wasmtime.
Definition: component/instance.h:24