Go to the source code of this file.
|
wasmtime_component_linker_t * | wasmtime_component_linker_new (const wasm_engine_t *engine) |
| Creates a new wasmtime_component_linker_t for the specified engine. More...
|
|
wasmtime_component_linker_instance_t * | wasmtime_component_linker_root (wasmtime_component_linker_t *linker) |
| Returns the "root instance" of this linker, used to define names into the root namespace. More...
|
|
wasmtime_error_t * | wasmtime_component_linker_instantiate (const wasmtime_component_linker_t *linker, wasmtime_context_t *context, const wasmtime_component_t *component, wasmtime_component_instance_t *instance_out) |
| Instantiates a component instance in a given wasmtime_context_t. More...
|
|
void | wasmtime_component_linker_delete (wasmtime_component_linker_t *linker) |
| Deletes a wasmtime_component_linker_t created by wasmtime_component_linker_new. More...
|
|
wasmtime_error_t * | wasmtime_component_linker_instance_add_instance (wasmtime_component_linker_instance_t *linker_instance, const char *name, size_t name_len, wasmtime_component_linker_instance_t **linker_instance_out) |
| Defines a nested instance within this instance. More...
|
|
wasmtime_error_t * | wasmtime_component_linker_instance_add_module (wasmtime_component_linker_instance_t *linker_instance, const char *name, size_t name_len, const wasmtime_module_t *module) |
| Defines a wasmtime_module_t within this instance. More...
|
|
wasmtime_error_t * | wasmtime_component_linker_instance_add_func (wasmtime_component_linker_instance_t *linker_instance, const char *name, size_t name_len, wasmtime_component_func_callback_t callback, void *data, void(*finalizer)()) |
| Define a function within this instance. More...
|
|
void | wasmtime_component_linker_instance_delete (wasmtime_component_linker_instance_t *linker_instance) |
| Deletes a wasmtime_component_linker_instance_t. More...
|
|
◆ wasmtime_component_linker_delete()
◆ wasmtime_component_linker_instance_add_func()
Define a function within this instance.
- Parameters
-
linker_instance | the instance to define the function in |
name | the module name |
name_len | length of name in bytes |
callback | the callback when this function gets called |
data | host-specific data passed to the callback invocation, can be NULL |
finalizer | optional finalizer for data , can be NULL |
- Returns
- on success
NULL
, otherwise an error
◆ wasmtime_component_linker_instance_add_instance()
Defines a nested instance within this instance.
This can be used to describe arbitrarily nested levels of instances within a linker to satisfy nested instance exports of components.
- Warning
- This acquires exclusive access to the
linker_instance
. The linker_instance
MUST not be accessed by anything until the returned wasmtime_component_linker_instance_t in linker_instance_out
is destroyed by wasmtime_component_linker_instance_delete.
- Parameters
-
linker_instance | the linker instance from which the new one is created |
name | new instance name |
name_len | length of name in bytes |
linker_instance_out | on success, the new wasmtime_component_linker_instance_t |
- Returns
- on success
NULL
, otherwise an error
◆ wasmtime_component_linker_instance_add_module()
Defines a wasmtime_module_t within this instance.
This can be used to provide a core wasm wasmtime_module_t as an import to a component. The wasmtime_module_t provided is saved within the linker for the specified name
in this instance.
- Parameters
-
linker_instance | the instance to define the module in |
name | the module name |
name_len | length of name in bytes |
module | the module |
- Returns
- on success
NULL
, otherwise an error
◆ wasmtime_component_linker_instance_delete()
◆ wasmtime_component_linker_instantiate()
Instantiates a component instance in a given wasmtime_context_t.
- Parameters
-
- Returns
- wasmtime_error_t* on success
NULL
is returned, otherwise an error is returned which describes why the build failed.
◆ wasmtime_component_linker_new()
◆ wasmtime_component_linker_root()