Wasmtime
component/instance.h File Reference

Go to the source code of this file.

Data Structures

struct  wasmtime_component_instance
 Representation of a instance in Wasmtime. More...
 

Typedefs

typedef struct wasmtime_component_instance wasmtime_component_instance_t
 Representation of a instance in Wasmtime. More...
 

Functions

wasmtime_component_export_index_twasmtime_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. More...
 
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. More...
 

Typedef Documentation

◆ wasmtime_component_instance_t

Representation of a instance in Wasmtime.

Instances are represented with a 64-bit identifying integer in Wasmtime. They do not have any destructor associated with them. Instances cannot interoperate between wasmtime_store_t instances and if the wrong instance is passed to the wrong store then it may trigger an assertion to abort the process.

Function Documentation

◆ wasmtime_component_instance_get_export_index()

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.

Parameters
instancethe instance to look up name in
contextthe context where instance lives in
instance_export_indexoptional (i.e. nullable) instance to look up in
namethe name of the export
name_lenlength of name in bytes
Returns
export index if found, else NULL

◆ wasmtime_component_instance_get_func()

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.

Parameters
instancethe instance to look up this name in
contextthe store that instance lives in
export_indexthe export index of the function
func_outif found, the function corresponding to name
Returns
boolean marking if a function for name was found