Expand description
Implements C-API support for the Wasmi WebAssembly interpreter.
Namely implements the Wasm C-API proposal found here: https://github.com/WebAssembly/wasm-c-api/
Re-exports§
pub use wasmi;
Structs§
- This representation of a
Store
is used to implement thewasm.h
API (and not thewasmi.h
API!) - Extensional data stored by
wasmi_store_t
to handle foreign data and optional WASI support. - A Wasm compatible vector with element type
u8
. - The Wasm configuration.
- The Wasm execution engine.
- A Wasm export type.
- A Wasm compatible vector with element type
Option<Box<wasm_exporttype_t>>
. - A Wasm external reference.
- A Wasm compatible vector with element type
Option<Box<wasm_extern_t>>
. - A Wasm extern type.
- A Wasm compatible vector with element type
Option<Box<wasm_externtype_t>>
. - A foreign defined non-Wasm object.
- A Wasm frame object.
- A Wasm compatible vector with element type [
Option<Box<wasm_frame_t<'a>>>
]. - A Wasm function.
- A Wasm function type.
- A Wasm compatible vector with element type
Option<Box<wasm_functype_t>>
. - A Wasm global variable.
- A Wasm global variable type.
- A Wasm compatible vector with element type
Option<Box<wasm_globaltype_t>>
. - A Wasm import type.
- A Wasm compatible vector with element type
Option<Box<wasm_importtype_t>>
. - A Wasm instance.
- Utility type representing minimum and maximum limitations for Wasm types.
- A Wasm linear memory.
- A Wasm linear memory type.
- A Wasm compatible vector with element type
Option<Box<wasm_memorytype_t>>
. - A Wasm module.
*mut wasm_ref_t
is a reference type (externref
orfuncref
) for the C API.- A shared Wasm module.
- The Wasm store.
- A Wasm table.
- A Wasm table type.
- A Wasm compatible vector with element type
Option<Box<wasm_tabletype_t>>
. - A Wasm trap.
- A Wasm value.
- A Wasm compatible vector with element type
wasm_val_t
. - A WebAssembly value type.
- A Wasm compatible vector with element type
Option<Box<wasm_valtype_t>>
. - An error that may occur when operating with Wasmi.
- The Wasm store with foreign data and optional WASI support.
Enums§
- The kind of a
wasm_externtype_t
. - The mutability of a
wasm_globaltype_t
. - The different kinds of
wasm_valtype_t
. - Compilation modes supported by the Wasmi execution engine.
Functions§
- Copies the
wasm_byte_vec_t
insrc
. - Frees memory associated to the
wasm_byte_vec_t
. - Creates an empty
wasm_byte_vec_t
- Creates an uninitialized
wasm_byte_vec_t
with the givensize
. - Deletes the
wasm_config_t
. - Creates a new default initialized
wasm_config_t
. - Deletes the
wasm_engine_t
. - Creates a new default initialized
wasm_engine_t
. - Creates a new
wasm_engine_t
initialized with awasm_config_t
. - Creates a new
wasm_exporttype_t
which matches the provided one. - Deletes the
wasm_exporttype_t
. - Returns a shared reference to the name of the
wasm_exporttype_t
. - Returns a shared reference to the extern type of the
wasm_exporttype_t
. - Copies the
wasm_exporttype_vec_t
insrc
. - Frees memory associated to the
wasm_exporttype_vec_t
. - Creates an empty
wasm_exporttype_vec_t
- Creates an uninitialized
wasm_exporttype_vec_t
with the givensize
. - Returns the
wasm_extern_t
as reference to mutablewasm_func_t
if possible. - Returns the
wasm_extern_t
as reference to sharedwasm_func_t
if possible. - Returns the
wasm_extern_t
as reference to mutablewasm_global_t
if possible. - Returns the
wasm_extern_t
as reference to sharedwasm_global_t
if possible. - Returns the
wasm_extern_t
as reference to mutablewasm_memory_t
if possible. - Returns the
wasm_extern_t
as reference to sharedwasm_memory_t
if possible. - Returns the
wasm_extern_t
as mutable reference. - Returns the
wasm_extern_t
as immutable reference. - Returns the
wasm_extern_t
as reference to mutablewasm_table_t
if possible. - Returns the
wasm_extern_t
as reference to sharedwasm_table_t
if possible. - Creates a new
wasm_extern_t
which matches the provided one. - Deletes the
wasm_extern_t
. - Returns the host information of the
wasm_extern_t
. - Returns the
wasm_extern_kind
of thewasm_extern_t
. - Returns
true
if the given references are pointing to the samewasm_extern_t
. - Sets the host information of the
wasm_extern_t
. - Sets the host information finalizer of the
wasm_extern_t
. - Returns the
wasm_externtype_t
of thewasm_extern_t
. - Copies the
wasm_extern_vec_t
insrc
. - Frees memory associated to the
wasm_extern_vec_t
. - Creates an empty
wasm_extern_vec_t
- Creates an uninitialized
wasm_extern_vec_t
with the givensize
. - Returns a mutable reference to the
wasm_externtype_t
aswasm_functype_t
. - Returns a shared reference to the
wasm_externtype_t
aswasm_functype_t
. - Returns a mutable reference to the
wasm_externtype_t
aswasm_globaltype_t
. - Returns a shared reference to the
wasm_externtype_t
aswasm_globaltype_t
. - Returns a mutable reference to the
wasm_externtype_t
aswasm_memorytype_t
. - Returns a shared reference to the
wasm_externtype_t
aswasm_memorytype_t
. - Returns a mutable reference to the
wasm_externtype_t
aswasm_tabletype_t
. - Returns a shared reference to the
wasm_externtype_t
aswasm_tabletype_t
. - Creates a new
wasm_externtype_t
which matches the provided one. - Deletes the
wasm_externtype_t
. - Returns the
wasm_externkind_t
of thewasm_externtype_t
. - Copies the
wasm_externtype_vec_t
insrc
. - Frees memory associated to the
wasm_externtype_vec_t
. - Creates an empty
wasm_externtype_vec_t
- Creates an uninitialized
wasm_externtype_vec_t
with the givensize
. - Returns the
wasm_foreign_t
as mutable reference. - Returns the
wasm_foreign_t
as immutable reference. - Creates a new
wasm_foreign_t
which matches the provided one. - Deletes the
wasm_foreign_t
. - Returns the host information of the
wasm_foreign_t
. - Creates a new foreign non-Wasm object for the
wasm_store_t
. - Returns
true
if the given references are pointing to the samewasm_foreign_t
. - Sets the host information of the
wasm_foreign_t
. - Sets the host information finalizer of the
wasm_foreign_t
. - Returns a copy of the
wasm_frame_t
. - Deletes the
wasm_frame_t
. - Returns the function index of the
wasm_frame_t
. - Returns the function offset of the
wasm_frame_t
. - Returns the
wasm_instance_t
of thewasm_frame_t
. - Returns the module offset of the
wasm_frame_t
. - Copies the
wasm_frame_vec_t
insrc
. - Frees memory associated to the
wasm_frame_vec_t
. - Creates an empty
wasm_frame_vec_t
- Creates an uninitialized
wasm_frame_vec_t
with the givensize
. - Returns the
wasm_func_t
as mutable reference towasm_extern_t
. - Returns the
wasm_func_t
as shared reference towasm_extern_t
. - Returns the
wasm_func_t
as mutable reference. - Returns the
wasm_func_t
as immutable reference. - Creates a new
wasm_func_t
which matches the provided one. - Deletes the
wasm_func_t
. - Returns the host information of the
wasm_func_t
. - Returns the number of parameter types of the
wasm_func_t
. - Returns the number of result types of the
wasm_func_t
. - Returns
true
if the given references are pointing to the samewasm_func_t
. - Sets the host information of the
wasm_func_t
. - Sets the host information finalizer of the
wasm_func_t
. - Returns the
wasm_functype_t
of thewasm_func_t
. - Returns a mutable reference to the element type of
wasm_functype_t
aswasm_externtype_t
. - Returns a shared reference to the element type of
wasm_functype_t
aswasm_externtype_t
. - Creates a new
wasm_functype_t
which matches the provided one. - Deletes the
wasm_functype_t
. - Creates a new
wasm_functype_t
from the given parameter and result types. - Returns a shared reference to the parameter types of the
wasm_functype_t
. - Returns a shared reference to the result types of the
wasm_functype_t
. - Copies the
wasm_functype_vec_t
insrc
. - Frees memory associated to the
wasm_functype_vec_t
. - Creates an empty
wasm_functype_vec_t
- Creates an uninitialized
wasm_functype_vec_t
with the givensize
. - Returns the
wasm_global_t
as mutable reference towasm_extern_t
. - Returns the
wasm_global_t
as shared reference towasm_extern_t
. - Returns the
wasm_global_t
as mutable reference. - Returns the
wasm_global_t
as immutable reference. - Creates a new
wasm_global_t
which matches the provided one. - Deletes the
wasm_global_t
. - Returns the current value of the
wasm_global_t
. - Returns the host information of the
wasm_global_t
. - Returns
true
if the given references are pointing to the samewasm_global_t
. - Sets the current value of the
wasm_global_t
. - Sets the host information of the
wasm_global_t
. - Sets the host information finalizer of the
wasm_global_t
. - Returns the
wasm_globaltype_t
of thewasm_global_t
. - Returns a mutable reference to the element type of
wasm_globaltype_t
aswasm_externtype_t
. - Returns a shared reference to the element type of
wasm_globaltype_t
aswasm_externtype_t
. - Returns a shared reference to the content type of the
wasm_globaltype_t
. - Creates a new
wasm_globaltype_t
which matches the provided one. - Deletes the
wasm_globaltype_t
. - Returns the mutability of the
wasm_globaltype_t
. - Creates a new
wasm_globaltype_t
with the given content type and mutability. - Copies the
wasm_globaltype_vec_t
insrc
. - Frees memory associated to the
wasm_globaltype_vec_t
. - Creates an empty
wasm_globaltype_vec_t
- Creates an uninitialized
wasm_globaltype_vec_t
with the givensize
. - Creates a new
wasm_importtype_t
which matches the provided one. - Deletes the
wasm_importtype_t
. - Returns a shared reference to the module namespace of the
wasm_importtype_t
. - Returns a shared reference to the name namespace of the
wasm_importtype_t
. - Returns a shared reference to the extern type of the
wasm_importtype_t
. - Copies the
wasm_importtype_vec_t
insrc
. - Frees memory associated to the
wasm_importtype_vec_t
. - Creates an empty
wasm_importtype_vec_t
- Creates an uninitialized
wasm_importtype_vec_t
with the givensize
. - Returns the
wasm_instance_t
as mutable reference. - Returns the
wasm_instance_t
as immutable reference. - Creates a new
wasm_instance_t
which matches the provided one. - Deletes the
wasm_instance_t
. - Returns the exports of the
wasm_instance_t
. - Returns the host information of the
wasm_instance_t
. - Instantiates the
wasm_module_t
with the given list ofimports
. - Returns
true
if the given references are pointing to the samewasm_instance_t
. - Sets the host information of the
wasm_instance_t
. - Sets the host information finalizer of the
wasm_instance_t
. - Returns the
wasm_memory_t
as mutable reference towasm_extern_t
. - Returns the
wasm_memory_t
as shared reference towasm_extern_t
. - Returns the
wasm_memory_t
as mutable reference. - Returns the
wasm_memory_t
as immutable reference. - Creates a new
wasm_memory_t
which matches the provided one. - Returns the underlying data pointer of the
wasm_memory_t
. - Returns the data buffer size of the
wasm_memory_t
. - Deletes the
wasm_memory_t
. - Returns the host information of the
wasm_memory_t
. - Grows the
wasm_memory_t
bydelta
Wasm pages. - Creates a new
wasm_memory_t
from the givenwasm_memorytype_t
. - Returns
true
if the given references are pointing to the samewasm_memory_t
. - Sets the host information of the
wasm_memory_t
. - Sets the host information finalizer of the
wasm_memory_t
. - Returns the current number of Wasm pages of the
wasm_memory_t
. - Returns the
wasm_memorytype_t
of thewasm_memory_t
. - Returns a mutable reference to the element type of
wasm_memorytype_t
aswasm_externtype_t
. - Returns a shared reference to the element type of
wasm_memorytype_t
aswasm_externtype_t
. - Creates a new
wasm_memorytype_t
which matches the provided one. - Deletes the
wasm_memorytype_t
. - Returns a shared reference to the table limits of the
wasm_memorytype_t
. - Creates a new
wasm_memorytype_t
with the givenlimits
. - Copies the
wasm_memorytype_vec_t
insrc
. - Frees memory associated to the
wasm_memorytype_vec_t
. - Creates an empty
wasm_memorytype_vec_t
- Creates an uninitialized
wasm_memorytype_vec_t
with the givensize
. - Returns the
wasm_module_t
as mutable reference. - Returns the
wasm_module_t
as immutable reference. - Creates a new
wasm_module_t
which matches the provided one. - Deletes the
wasm_module_t
. - Deserializes the binary as a
wasm_module_t
. - Queries the module exports of the
wasm_module_t
. - Returns the host information of the
wasm_module_t
. - Queries the module imports of the
wasm_module_t
. - Obtains the
wasm_module_t
from thewasm_shared_module_t
. - Returns
true
if the given references are pointing to the samewasm_module_t
. - Serializes the
wasm_module_t
into a binary. - Sets the host information of the
wasm_module_t
. - Sets the host information finalizer of the
wasm_module_t
. - Shares the
module
and returns a shared image aswasm_shared_module_t
. - Returns
true
if the Wasmbinary
successfully validates. - Copies the
wasm_ref_t
and returns the copied reference. - Deletes the
wasm_ref_t
. - Returns the host information of the
wasm_ref_t
. - Returns
true
if bothwasm_ref_t
references are referencing the same objects. - Sets the host information of the
wasm_ref_t
toinfo
. - Deletes the
wasm_shared_module_t
. - Deletes the
wasm_store_t
. - Creates a new
Store<()>
for the givenengine
. - Returns the
wasm_table_t
as mutable reference towasm_extern_t
. - Returns the
wasm_table_t
as shared reference towasm_extern_t
. - Returns the
wasm_table_t
as mutable reference. - Returns the
wasm_table_t
as immutable reference. - Creates a new
wasm_table_t
which matches the provided one. - Deletes the
wasm_table_t
. - Returns the host information of the
wasm_table_t
. - Grows the number of cells of the
wasm_table_t
bydelta
. - Creates a new
wasm_table_t
from the givenwasm_tabletype_t
. - Returns
true
if the given references are pointing to the samewasm_table_t
. - Sets the host information of the
wasm_table_t
. - Sets the host information finalizer of the
wasm_table_t
. - Returns the number of cells of the
wasm_table_t
. - Returns the
wasm_tabletype_t
of thewasm_table_t
. - Returns a mutable reference to the element type of
wasm_tabletype_t
aswasm_externtype_t
. - Returns a shared reference to the element type of
wasm_tabletype_t
aswasm_externtype_t
. - Creates a new
wasm_tabletype_t
which matches the provided one. - Deletes the
wasm_tabletype_t
. - Returns a shared reference to the element type of the
wasm_tabletype_t
. - Returns a shared reference to the table limits of the
wasm_tabletype_t
. - Copies the
wasm_tabletype_vec_t
insrc
. - Frees memory associated to the
wasm_tabletype_vec_t
. - Creates an empty
wasm_tabletype_vec_t
- Creates an uninitialized
wasm_tabletype_vec_t
with the givensize
. - Returns the
wasm_trap_t
as mutable reference. - Returns the
wasm_trap_t
as immutable reference. - Creates a new
wasm_trap_t
which matches the provided one. - Deletes the
wasm_trap_t
. - Returns the host information of the
wasm_trap_t
. - Returns the error message of the
wasm_trap_t
. - Returns the origin of the
wasm_trap_t
if any. - Returns
true
if the given references are pointing to the samewasm_trap_t
. - Sets the host information of the
wasm_trap_t
. - Sets the host information finalizer of the
wasm_trap_t
. - Returns the trace of the
wasm_trap_t
. - Copies the
wasm_val_t
and stores the result inout
. - Deletes the
wasm_val_t
. - Copies the
wasm_val_vec_t
insrc
. - Frees memory associated to the
wasm_val_vec_t
. - Creates an empty
wasm_val_vec_t
- Creates an uninitialized
wasm_val_vec_t
with the givensize
. - Creates a new
wasm_valtype_t
which matches the provided one. - Deletes the
wasm_valtype_t
. - Returns the
wasm_valkind_t
of thewasm_valtype_t
. - Creates a new owned
wasm_valtype_t
from thewasm_valkind_t
. - Copies the
wasm_valtype_vec_t
insrc
. - Frees memory associated to the
wasm_valtype_vec_t
. - Creates an empty
wasm_valtype_vec_t
- Creates an uninitialized
wasm_valtype_vec_t
with the givensize
. - Enables or disables fuel consumption for the config.
- Enables or disables support for floating point numbers for the config.
- Enables or disables processing of Wasm custom sections.
- Sets the compilation mode for the config.
- Enables or disables support for the Wasm
bulk-memory-operations
proposal. - Enables or disables support for the Wasm
extended-const
proposal. - Enables or disables support for the Wasm
multi-value
proposal. - Enables or disables support for the Wasm
mutable-global
proposal. - Enables or disables support for the Wasm
reference-types
proposal. - Enables or disables support for the Wasm
nontrapping-float-to-int-conversions
proposal. - Enables or disables support for the Wasm
sign-extension-ops
proposal. - Enables or disables support for the Wasm
tail-call
proposal. - Returns a pointer to the foreign data of the Wasmi store context.
- Returns the current fuel of the Wasmi store context in
fuel
. - Sets the foreign data of the Wasmi store context.
- Sets the current fuel of the Wasmi store context to
fuel
. - Clones a
wasm_engine_t
. - Deletes the
wasmi_error_t
. - Creates a new
wasmi_error_t
with the given error message. - Returns mutable access to the store context of the
wasmi_store_t
. - Deletes the
wasmi_store_t
. - Creates a new
Store<()>
for the givenengine
.
Type Aliases§
- A Wasm host function callback.
- A Wasm host function callback with access to environmental data.
- Type specifying the number of pages of a Wasm linear memory.
- A Wasm error message string buffer.
- A Wasm name string buffer.
- Type specifying the number of cells of a Wasm table.
Unions§
- The underlying data of a
wasm_val_t
.