Wasmtime
wasmtime::component::Instance Class Reference

Class representing an instantiated WebAssembly component. More...

#include <instance.hh>

Public Member Functions

 Instance (const wasmtime_component_instance_t &inst)
 Constructs an Instance from the underlying C API struct.
 
std::optional< ExportIndexget_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. More...
 
std::optional< Funcget_func (Store::Context cx, const ExportIndex &index) const
 Looks up an exported function by its export index.
 
const wasmtime_component_instance_tcapi () const
 Returns the underlying C API pointer.
 

Detailed Description

Class representing an instantiated WebAssembly component.

Member Function Documentation

◆ get_export_index()

std::optional< ExportIndex > wasmtime::component::Instance::get_export_index ( Store::Context  cx,
const ExportIndex instance,
std::string_view  name 
) const
inline

Looks up an exported item from this instance by name, returning the index at which it can be found.

The returned ExportIndex references the underlying item within this instance which can then be accessed via that index specifically. The instance provided as an argument to this function is the containing export instance, if any, that name is looked up under.


The documentation for this class was generated from the following file: