[][src]Module wasmer_runtime_c_api::import

Create, read, destroy import definitions (function, global, memory and table) on an instance.

Structs

NamedImportDescriptors
wasmer_import_descriptor_t
wasmer_import_descriptors_t
wasmer_import_func_t
wasmer_import_object_iter_t
wasmer_import_object_t
wasmer_import_t
wasmer_wasi_map_dir_entry_t

Opens a directory that's visible to the WASI module as alias but is backed by the host file at host_file_path

Enums

Version

Functions

wasmer_import_descriptor_kind

Gets export descriptor kind

wasmer_import_descriptor_module_name

Gets module name for the import descriptor

wasmer_import_descriptor_name

Gets name for the import descriptor

wasmer_import_descriptors

Gets import descriptors for the given module

wasmer_import_descriptors_destroy

Frees the memory for the given import descriptors

wasmer_import_descriptors_get

Gets import descriptor by index

wasmer_import_descriptors_len

Gets the length of the import descriptors

wasmer_import_func_destroy

Frees memory for the given Func

wasmer_import_func_new

Creates new host function, aka imported function. func is a function pointer, where the first argument is the famous vm::Ctx (in Rust), or wasmer_instance_context_t (in C). All arguments must be typed with compatible WebAssembly native types:

wasmer_import_func_params

Sets the params buffer to the parameter types of the given wasmer_import_func_t

wasmer_import_func_params_arity

Sets the result parameter to the arity of the params of the wasmer_import_func_t

wasmer_import_func_returns

Sets the returns buffer to the parameter types of the given wasmer_import_func_t

wasmer_import_func_returns_arity

Sets the result parameter to the arity of the returns of the wasmer_import_func_t

wasmer_import_object_destroy

Frees memory of the given ImportObject

wasmer_import_object_extend

Extends an existing import object with new imports

wasmer_import_object_get_import

Gets an entry from an ImportObject at the name and namespace. Stores name, namespace, and import_export_value in import. Thus these must remain valid for the lifetime of import.

wasmer_import_object_imports_destroy

Frees the memory allocated in wasmer_import_object_iter_next

wasmer_import_object_iter_at_end

Returns true if further calls to wasmer_import_object_iter_next will not return any new data

wasmer_import_object_iter_destroy

Frees the memory allocated by wasmer_import_object_iterate_functions

wasmer_import_object_iter_next

Writes the next value to import. WASMER_ERROR is returned if there was an error or there's nothing left to return.

wasmer_import_object_iterate_functions

Create an iterator over the functions in the import object. Get the next import with wasmer_import_object_iter_next Free the iterator with wasmer_import_object_iter_destroy

wasmer_import_object_new

Creates a new empty import object. See also wasmer_import_object_append

wasmer_trap

Stop the execution of a host function, aka imported function. The function must be used only inside a host function.

wasmer_wasi_generate_default_import_object

Convenience function that creates a WASI import object with no arguments, environment variables, preopened files, or mapped directories.

wasmer_wasi_generate_import_object

Creates a WASI import object.

wasmer_wasi_generate_import_object_for_version

Creates a WASI import object for a specific version.

wasmer_wasi_get_version

Find the version of WASI used by the module.