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/
§Crate features
§The prefix-symbols
feature
Adds a wasmi_
prefix to all the public symbols. This means that, for example, the function wasm_store_delete
will be given the public (not mangled) symbol wasmi_wasm_store_delete
.
§Rationale
This feature allows users that need to separate multiple C-API implementers to segregate wasmi’s C-API symbols, avoiding symbol clashes.
§Note
It’s important to notice that when the prefix-symbols
feature is enabled, the symbols declared in the C-API header
are not given the prefix, introducing - by design, in order to keep the C-API header same as the actual
specification - an asymmetry. For example, Rust users that want to enable this feature, can use bindgen
to
generate correct C-to-Rust interop code:
#[derive(Debug)]
struct WasmiRenamer {}
impl ParseCallbacks for WasmiRenamer {
/// This function will run for every extern variable and function. The returned value determines
/// the link name in the bindings.
fn generated_link_name_override(
&self,
item_info: bindgen::callbacks::ItemInfo<'_>,
) -> Option<String> {
if item_info.name.starts_with("wasm") {
let new_name = if cfg!(any(target_os = "macos", target_os = "ios")) {
format!("_wasmi_{}", item_info.name)
} else {
format!("wasmi_{}", item_info.name)
};
Some(new_name)
} else {
None
}
}
}
let bindings = bindgen::Builder::default()
.header(
PathBuf::from(std::env::var("DEP_WASMI_C_API_INCLUDE").unwrap())
.join("wasm.h")
.to_string_lossy(),
)
.derive_default(true)
.derive_debug(true)
.parse_callbacks(Box::new(WasmiRenamer {}))
.generate()
.expect("Unable to generate bindings for `wasmi`!");
Re-exports§
pub use wasmi;
Structs§
- Wasm
Store Ref - This representation of a
Store
is used to implement thewasm.h
API (and not thewasmi.h
API!) - Wasmi
Store Data - Extensional data stored by
wasmi_store_t
to handle foreign data and optional WASI support. - wasm_
byte_ vec_ t - A Wasm compatible vector with element type
u8
. - wasm_
config_ t - The Wasm configuration.
- wasm_
engine_ t - The Wasm execution engine.
- wasm_
exporttype_ t - A Wasm export type.
- wasm_
exporttype_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_exporttype_t>>
. - wasm_
extern_ t - A Wasm external reference.
- wasm_
extern_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_extern_t>>
. - wasm_
externtype_ t - A Wasm extern type.
- wasm_
externtype_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_externtype_t>>
. - wasm_
foreign_ t - A foreign defined non-Wasm object.
- wasm_
frame_ t - A Wasm frame object.
- wasm_
frame_ vec_ t - A Wasm compatible vector with element type [
Option<Box<wasm_frame_t<'a>>>
]. - wasm_
func_ t - A Wasm function.
- wasm_
functype_ t - A Wasm function type.
- wasm_
functype_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_functype_t>>
. - wasm_
global_ t - A Wasm global variable.
- wasm_
globaltype_ t - A Wasm global variable type.
- wasm_
globaltype_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_globaltype_t>>
. - wasm_
importtype_ t - A Wasm import type.
- wasm_
importtype_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_importtype_t>>
. - wasm_
instance_ t - A Wasm instance.
- wasm_
limits_ t - Utility type representing minimum and maximum limitations for Wasm types.
- wasm_
memory_ t - A Wasm linear memory.
- wasm_
memorytype_ t - A Wasm linear memory type.
- wasm_
memorytype_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_memorytype_t>>
. - wasm_
module_ t - A Wasm module.
- wasm_
ref_ t *mut wasm_ref_t
is a reference type (externref
orfuncref
) for the C API.- wasm_
shared_ module_ t - A shared Wasm module.
- wasm_
store_ t - The Wasm store.
- wasm_
table_ t - A Wasm table.
- wasm_
tabletype_ t - A Wasm table type.
- wasm_
tabletype_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_tabletype_t>>
. - wasm_
trap_ t - A Wasm trap.
- wasm_
val_ t - A Wasm value.
- wasm_
val_ vec_ t - A Wasm compatible vector with element type
wasm_val_t
. - wasm_
valtype_ t - A WebAssembly value type.
- wasm_
valtype_ vec_ t - A Wasm compatible vector with element type
Option<Box<wasm_valtype_t>>
. - wasmi_
error_ t - An error that may occur when operating with Wasmi.
- wasmi_
store_ t - The Wasm store with foreign data and optional WASI support.
Enums§
- wasm_
externkind_ t - The kind of a
wasm_externtype_t
. - wasm_
mutability_ t - The mutability of a
wasm_globaltype_t
. - wasm_
valkind_ t - The different kinds of
wasm_valtype_t
. - wasmi_
compilation_ mode_ t - Compilation modes supported by the Wasmi execution engine.
Functions§
- wasm_
byte_ vec_ copy - Copies the
wasm_byte_vec_t
insrc
. - wasm_
byte_ vec_ delete - Frees memory associated to the
wasm_byte_vec_t
. - wasm_
byte_ ⚠vec_ new - Creates an new
wasm_byte_vec_t
with the givensize
andptr
data. - wasm_
byte_ vec_ new_ empty - Creates an empty
wasm_byte_vec_t
- wasm_
byte_ vec_ new_ uninitialized - Creates an uninitialized
wasm_byte_vec_t
with the givensize
. - wasm_
config_ delete - Deletes the
wasm_config_t
. - wasm_
config_ new - Creates a new default initialized
wasm_config_t
. - wasm_
engine_ delete - Deletes the
wasm_engine_t
. - wasm_
engine_ new - Creates a new default initialized
wasm_engine_t
. - wasm_
engine_ new_ with_ config - Creates a new
wasm_engine_t
initialized with awasm_config_t
. - wasm_
exporttype_ copy - Creates a new
wasm_exporttype_t
which matches the provided one. - wasm_
exporttype_ delete - Deletes the
wasm_exporttype_t
. - wasm_
exporttype_ name - Returns a shared reference to the name of the
wasm_exporttype_t
. - wasm_
exporttype_ new - Creates a new
wasm_exporttype_t
with the givenname
and extern typety
- wasm_
exporttype_ type - Returns a shared reference to the extern type of the
wasm_exporttype_t
. - wasm_
exporttype_ vec_ copy - Copies the
wasm_exporttype_vec_t
insrc
. - wasm_
exporttype_ vec_ delete - Frees memory associated to the
wasm_exporttype_vec_t
. - wasm_
exporttype_ ⚠vec_ new - Creates an new
wasm_exporttype_vec_t
with the givensize
andptr
data. - wasm_
exporttype_ vec_ new_ empty - Creates an empty
wasm_exporttype_vec_t
- wasm_
exporttype_ vec_ new_ uninitialized - Creates an uninitialized
wasm_exporttype_vec_t
with the givensize
. - wasm_
extern_ as_ func - Returns the
wasm_extern_t
as reference to mutablewasm_func_t
if possible. - wasm_
extern_ as_ func_ const - Returns the
wasm_extern_t
as reference to sharedwasm_func_t
if possible. - wasm_
extern_ as_ global - Returns the
wasm_extern_t
as reference to mutablewasm_global_t
if possible. - wasm_
extern_ as_ global_ const - Returns the
wasm_extern_t
as reference to sharedwasm_global_t
if possible. - wasm_
extern_ as_ memory - Returns the
wasm_extern_t
as reference to mutablewasm_memory_t
if possible. - wasm_
extern_ as_ memory_ const - Returns the
wasm_extern_t
as reference to sharedwasm_memory_t
if possible. - wasm_
extern_ as_ ref - Returns the
wasm_extern_t
as mutable reference. - wasm_
extern_ as_ ref_ const - Returns the
wasm_extern_t
as immutable reference. - wasm_
extern_ as_ table - Returns the
wasm_extern_t
as reference to mutablewasm_table_t
if possible. - wasm_
extern_ as_ table_ const - Returns the
wasm_extern_t
as reference to sharedwasm_table_t
if possible. - wasm_
extern_ copy - Creates a new
wasm_extern_t
which matches the provided one. - wasm_
extern_ delete - Deletes the
wasm_extern_t
. - wasm_
extern_ get_ host_ info - Returns the host information of the
wasm_extern_t
. - wasm_
extern_ kind - Returns the
wasm_extern_kind
of thewasm_extern_t
. - wasm_
extern_ same - Returns
true
if the given references are pointing to the samewasm_extern_t
. - wasm_
extern_ set_ host_ info - Sets the host information of the
wasm_extern_t
. - wasm_
extern_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_extern_t
. - wasm_
extern_ ⚠type - Returns the
wasm_externtype_t
of thewasm_extern_t
. - wasm_
extern_ vec_ copy - Copies the
wasm_extern_vec_t
insrc
. - wasm_
extern_ vec_ delete - Frees memory associated to the
wasm_extern_vec_t
. - wasm_
extern_ ⚠vec_ new - Creates an new
wasm_extern_vec_t
with the givensize
andptr
data. - wasm_
extern_ vec_ new_ empty - Creates an empty
wasm_extern_vec_t
- wasm_
extern_ vec_ new_ uninitialized - Creates an uninitialized
wasm_extern_vec_t
with the givensize
. - wasm_
externtype_ as_ functype - Returns a mutable reference to the
wasm_externtype_t
aswasm_functype_t
. - wasm_
externtype_ as_ functype_ const - Returns a shared reference to the
wasm_externtype_t
aswasm_functype_t
. - wasm_
externtype_ as_ globaltype - Returns a mutable reference to the
wasm_externtype_t
aswasm_globaltype_t
. - wasm_
externtype_ as_ globaltype_ const - Returns a shared reference to the
wasm_externtype_t
aswasm_globaltype_t
. - wasm_
externtype_ as_ memorytype - Returns a mutable reference to the
wasm_externtype_t
aswasm_memorytype_t
. - wasm_
externtype_ as_ memorytype_ const - Returns a shared reference to the
wasm_externtype_t
aswasm_memorytype_t
. - wasm_
externtype_ as_ tabletype - Returns a mutable reference to the
wasm_externtype_t
aswasm_tabletype_t
. - wasm_
externtype_ as_ tabletype_ const - Returns a shared reference to the
wasm_externtype_t
aswasm_tabletype_t
. - wasm_
externtype_ copy - Creates a new
wasm_externtype_t
which matches the provided one. - wasm_
externtype_ delete - Deletes the
wasm_externtype_t
. - wasm_
externtype_ kind - Returns the
wasm_externkind_t
of thewasm_externtype_t
. - wasm_
externtype_ vec_ copy - Copies the
wasm_externtype_vec_t
insrc
. - wasm_
externtype_ vec_ delete - Frees memory associated to the
wasm_externtype_vec_t
. - wasm_
externtype_ ⚠vec_ new - Creates an new
wasm_externtype_vec_t
with the givensize
andptr
data. - wasm_
externtype_ vec_ new_ empty - Creates an empty
wasm_externtype_vec_t
- wasm_
externtype_ vec_ new_ uninitialized - Creates an uninitialized
wasm_externtype_vec_t
with the givensize
. - wasm_
foreign_ as_ ref - Returns the
wasm_foreign_t
as mutable reference. - wasm_
foreign_ as_ ref_ const - Returns the
wasm_foreign_t
as immutable reference. - wasm_
foreign_ copy - Creates a new
wasm_foreign_t
which matches the provided one. - wasm_
foreign_ delete - Deletes the
wasm_foreign_t
. - wasm_
foreign_ get_ host_ info - Returns the host information of the
wasm_foreign_t
. - wasm_
foreign_ new - Creates a new foreign non-Wasm object for the
wasm_store_t
. - wasm_
foreign_ same - Returns
true
if the given references are pointing to the samewasm_foreign_t
. - wasm_
foreign_ set_ host_ info - Sets the host information of the
wasm_foreign_t
. - wasm_
foreign_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_foreign_t
. - wasm_
frame_ copy - Returns a copy of the
wasm_frame_t
. - wasm_
frame_ delete - Deletes the
wasm_frame_t
. - wasm_
frame_ func_ index - Returns the function index of the
wasm_frame_t
. - wasm_
frame_ func_ offset - Returns the function offset of the
wasm_frame_t
. - wasm_
frame_ instance - Returns the
wasm_instance_t
of thewasm_frame_t
. - wasm_
frame_ module_ offset - Returns the module offset of the
wasm_frame_t
. - wasm_
frame_ vec_ copy - Copies the
wasm_frame_vec_t
insrc
. - wasm_
frame_ vec_ delete - Frees memory associated to the
wasm_frame_vec_t
. - wasm_
frame_ ⚠vec_ new - Creates an new
wasm_frame_vec_t
with the givensize
andptr
data. - wasm_
frame_ vec_ new_ empty - Creates an empty
wasm_frame_vec_t
- wasm_
frame_ vec_ new_ uninitialized - Creates an uninitialized
wasm_frame_vec_t
with the givensize
. - wasm_
func_ as_ extern - Returns the
wasm_func_t
as mutable reference towasm_extern_t
. - wasm_
func_ as_ extern_ const - Returns the
wasm_func_t
as shared reference towasm_extern_t
. - wasm_
func_ as_ ref - Returns the
wasm_func_t
as mutable reference. - wasm_
func_ as_ ref_ const - Returns the
wasm_func_t
as immutable reference. - wasm_
func_ ⚠call - Calls the
wasm_func_t
with the givenparams
and stores the result inresults
. - wasm_
func_ copy - Creates a new
wasm_func_t
which matches the provided one. - wasm_
func_ delete - Deletes the
wasm_func_t
. - wasm_
func_ get_ host_ info - Returns the host information of the
wasm_func_t
. - wasm_
func_ ⚠new - Creates a new
wasm_func_t
of typewasm_functype_t
for thewasm_store_t
. - wasm_
func_ ⚠new_ with_ env - Creates a new
wasm_func_t
of typewasm_functype_t
for thewasm_store_t
. - wasm_
func_ ⚠param_ arity - Returns the number of parameter types of the
wasm_func_t
. - wasm_
func_ ⚠result_ arity - Returns the number of result types of the
wasm_func_t
. - wasm_
func_ same - Returns
true
if the given references are pointing to the samewasm_func_t
. - wasm_
func_ set_ host_ info - Sets the host information of the
wasm_func_t
. - wasm_
func_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_func_t
. - wasm_
func_ ⚠type - Returns the
wasm_functype_t
of thewasm_func_t
. - wasm_
functype_ as_ externtype - Returns a mutable reference to the element type of
wasm_functype_t
aswasm_externtype_t
. - wasm_
functype_ as_ externtype_ const - Returns a shared reference to the element type of
wasm_functype_t
aswasm_externtype_t
. - wasm_
functype_ copy - Creates a new
wasm_functype_t
which matches the provided one. - wasm_
functype_ delete - Deletes the
wasm_functype_t
. - wasm_
functype_ new - Creates a new
wasm_functype_t
from the given parameter and result types. - wasm_
functype_ params - Returns a shared reference to the parameter types of the
wasm_functype_t
. - wasm_
functype_ results - Returns a shared reference to the result types of the
wasm_functype_t
. - wasm_
functype_ vec_ copy - Copies the
wasm_functype_vec_t
insrc
. - wasm_
functype_ vec_ delete - Frees memory associated to the
wasm_functype_vec_t
. - wasm_
functype_ ⚠vec_ new - Creates an new
wasm_functype_vec_t
with the givensize
andptr
data. - wasm_
functype_ vec_ new_ empty - Creates an empty
wasm_functype_vec_t
- wasm_
functype_ vec_ new_ uninitialized - Creates an uninitialized
wasm_functype_vec_t
with the givensize
. - wasm_
global_ as_ extern - Returns the
wasm_global_t
as mutable reference towasm_extern_t
. - wasm_
global_ as_ extern_ const - Returns the
wasm_global_t
as shared reference towasm_extern_t
. - wasm_
global_ as_ ref - Returns the
wasm_global_t
as mutable reference. - wasm_
global_ as_ ref_ const - Returns the
wasm_global_t
as immutable reference. - wasm_
global_ copy - Creates a new
wasm_global_t
which matches the provided one. - wasm_
global_ delete - Deletes the
wasm_global_t
. - wasm_
global_ ⚠get - Returns the current value of the
wasm_global_t
. - wasm_
global_ get_ host_ info - Returns the host information of the
wasm_global_t
. - wasm_
global_ ⚠new - Creates a new
wasm_global_t
from the givenwasm_globaltype_t
andwasm_val_t
. - wasm_
global_ same - Returns
true
if the given references are pointing to the samewasm_global_t
. - wasm_
global_ ⚠set - Sets the current value of the
wasm_global_t
. - wasm_
global_ set_ host_ info - Sets the host information of the
wasm_global_t
. - wasm_
global_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_global_t
. - wasm_
global_ ⚠type - Returns the
wasm_globaltype_t
of thewasm_global_t
. - wasm_
globaltype_ as_ externtype - Returns a mutable reference to the element type of
wasm_globaltype_t
aswasm_externtype_t
. - wasm_
globaltype_ as_ externtype_ const - Returns a shared reference to the element type of
wasm_globaltype_t
aswasm_externtype_t
. - wasm_
globaltype_ content - Returns a shared reference to the content type of the
wasm_globaltype_t
. - wasm_
globaltype_ copy - Creates a new
wasm_globaltype_t
which matches the provided one. - wasm_
globaltype_ delete - Deletes the
wasm_globaltype_t
. - wasm_
globaltype_ mutability - Returns the mutability of the
wasm_globaltype_t
. - wasm_
globaltype_ new - Creates a new
wasm_globaltype_t
with the given content type and mutability. - wasm_
globaltype_ vec_ copy - Copies the
wasm_globaltype_vec_t
insrc
. - wasm_
globaltype_ vec_ delete - Frees memory associated to the
wasm_globaltype_vec_t
. - wasm_
globaltype_ ⚠vec_ new - Creates an new
wasm_globaltype_vec_t
with the givensize
andptr
data. - wasm_
globaltype_ vec_ new_ empty - Creates an empty
wasm_globaltype_vec_t
- wasm_
globaltype_ vec_ new_ uninitialized - Creates an uninitialized
wasm_globaltype_vec_t
with the givensize
. - wasm_
importtype_ copy - Creates a new
wasm_importtype_t
which matches the provided one. - wasm_
importtype_ delete - Deletes the
wasm_importtype_t
. - wasm_
importtype_ module - Returns a shared reference to the module namespace of the
wasm_importtype_t
. - wasm_
importtype_ name - Returns a shared reference to the name namespace of the
wasm_importtype_t
. - wasm_
importtype_ new - Creates a new
wasm_importtype_t
from the givenmodule
andname
namespace and extern typety
. - wasm_
importtype_ type - Returns a shared reference to the extern type of the
wasm_importtype_t
. - wasm_
importtype_ vec_ copy - Copies the
wasm_importtype_vec_t
insrc
. - wasm_
importtype_ vec_ delete - Frees memory associated to the
wasm_importtype_vec_t
. - wasm_
importtype_ ⚠vec_ new - Creates an new
wasm_importtype_vec_t
with the givensize
andptr
data. - wasm_
importtype_ vec_ new_ empty - Creates an empty
wasm_importtype_vec_t
- wasm_
importtype_ vec_ new_ uninitialized - Creates an uninitialized
wasm_importtype_vec_t
with the givensize
. - wasm_
instance_ as_ ref - Returns the
wasm_instance_t
as mutable reference. - wasm_
instance_ as_ ref_ const - Returns the
wasm_instance_t
as immutable reference. - wasm_
instance_ copy - Creates a new
wasm_instance_t
which matches the provided one. - wasm_
instance_ delete - Deletes the
wasm_instance_t
. - wasm_
instance_ ⚠exports - Returns the exports of the
wasm_instance_t
. - wasm_
instance_ get_ host_ info - Returns the host information of the
wasm_instance_t
. - wasm_
instance_ ⚠new - Instantiates the
wasm_module_t
with the given list ofimports
. - wasm_
instance_ same - Returns
true
if the given references are pointing to the samewasm_instance_t
. - wasm_
instance_ set_ host_ info - Sets the host information of the
wasm_instance_t
. - wasm_
instance_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_instance_t
. - wasm_
memory_ as_ extern - Returns the
wasm_memory_t
as mutable reference towasm_extern_t
. - wasm_
memory_ as_ extern_ const - Returns the
wasm_memory_t
as shared reference towasm_extern_t
. - wasm_
memory_ as_ ref - Returns the
wasm_memory_t
as mutable reference. - wasm_
memory_ as_ ref_ const - Returns the
wasm_memory_t
as immutable reference. - wasm_
memory_ copy - Creates a new
wasm_memory_t
which matches the provided one. - wasm_
memory_ ⚠data - Returns the underlying data pointer of the
wasm_memory_t
. - wasm_
memory_ ⚠data_ size - Returns the data buffer size of the
wasm_memory_t
. - wasm_
memory_ delete - Deletes the
wasm_memory_t
. - wasm_
memory_ get_ host_ info - Returns the host information of the
wasm_memory_t
. - wasm_
memory_ ⚠grow - Grows the
wasm_memory_t
bydelta
Wasm pages. - wasm_
memory_ ⚠new - Creates a new
wasm_memory_t
from the givenwasm_memorytype_t
. - wasm_
memory_ same - Returns
true
if the given references are pointing to the samewasm_memory_t
. - wasm_
memory_ set_ host_ info - Sets the host information of the
wasm_memory_t
. - wasm_
memory_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_memory_t
. - wasm_
memory_ ⚠size - Returns the current number of Wasm pages of the
wasm_memory_t
. - wasm_
memory_ ⚠type - Returns the
wasm_memorytype_t
of thewasm_memory_t
. - wasm_
memorytype_ as_ externtype - Returns a mutable reference to the element type of
wasm_memorytype_t
aswasm_externtype_t
. - wasm_
memorytype_ as_ externtype_ const - Returns a shared reference to the element type of
wasm_memorytype_t
aswasm_externtype_t
. - wasm_
memorytype_ copy - Creates a new
wasm_memorytype_t
which matches the provided one. - wasm_
memorytype_ delete - Deletes the
wasm_memorytype_t
. - wasm_
memorytype_ limits - Returns a shared reference to the table limits of the
wasm_memorytype_t
. - wasm_
memorytype_ new - Creates a new
wasm_memorytype_t
with the givenlimits
. - wasm_
memorytype_ vec_ copy - Copies the
wasm_memorytype_vec_t
insrc
. - wasm_
memorytype_ vec_ delete - Frees memory associated to the
wasm_memorytype_vec_t
. - wasm_
memorytype_ ⚠vec_ new - Creates an new
wasm_memorytype_vec_t
with the givensize
andptr
data. - wasm_
memorytype_ vec_ new_ empty - Creates an empty
wasm_memorytype_vec_t
- wasm_
memorytype_ vec_ new_ uninitialized - Creates an uninitialized
wasm_memorytype_vec_t
with the givensize
. - wasm_
module_ as_ ref - Returns the
wasm_module_t
as mutable reference. - wasm_
module_ as_ ref_ const - Returns the
wasm_module_t
as immutable reference. - wasm_
module_ copy - Creates a new
wasm_module_t
which matches the provided one. - wasm_
module_ delete - Deletes the
wasm_module_t
. - wasm_
module_ ⚠deserialize - Deserializes the binary as a
wasm_module_t
. - wasm_
module_ exports - Queries the module exports of the
wasm_module_t
. - wasm_
module_ get_ host_ info - Returns the host information of the
wasm_module_t
. - wasm_
module_ imports - Queries the module imports of the
wasm_module_t
. - wasm_
module_ ⚠new - Creates a new
wasm_module_t
forstore
from the given Wasmbinary
. - wasm_
module_ ⚠obtain - Obtains the
wasm_module_t
from thewasm_shared_module_t
. - wasm_
module_ same - Returns
true
if the given references are pointing to the samewasm_module_t
. - wasm_
module_ serialize - Serializes the
wasm_module_t
into a binary. - wasm_
module_ set_ host_ info - Sets the host information of the
wasm_module_t
. - wasm_
module_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_module_t
. - wasm_
module_ share - Shares the
module
and returns a shared image aswasm_shared_module_t
. - wasm_
module_ ⚠validate - Returns
true
if the Wasmbinary
successfully validates. - wasm_
ref_ as_ extern - Returns the
wasm_ref_t
as sharedwasm_extern_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ extern_ const - Returns the
wasm_ref_t
as mutablewasm_extern_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ foreign - Returns the
wasm_ref_t
as sharedwasm_foreign_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ foreign_ const - Returns the
wasm_ref_t
as mutablewasm_foreign_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ func - Returns the
wasm_ref_t
as sharedwasm_func_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ func_ const - Returns the
wasm_ref_t
as mutablewasm_func_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ global - Returns the
wasm_ref_t
as sharedwasm_global_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ global_ const - Returns the
wasm_ref_t
as mutablewasm_global_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ instance - Returns the
wasm_ref_t
as sharedwasm_instance_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ instance_ const - Returns the
wasm_ref_t
as mutablewasm_instance_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ memory - Returns the
wasm_ref_t
as sharedwasm_memory_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ memory_ const - Returns the
wasm_ref_t
as mutablewasm_memory_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ module - Returns the
wasm_ref_t
as sharedwasm_module_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ module_ const - Returns the
wasm_ref_t
as mutablewasm_module_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ table - Returns the
wasm_ref_t
as sharedwasm_table_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ table_ const - Returns the
wasm_ref_t
as mutablewasm_table_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ trap - Returns the
wasm_ref_t
as sharedwasm_trap_t
if possible or otherwise returnsNone
. - wasm_
ref_ as_ trap_ const - Returns the
wasm_ref_t
as mutablewasm_trap_t
if possible or otherwise returnsNone
. - wasm_
ref_ copy - Copies the
wasm_ref_t
and returns the copied reference. - wasm_
ref_ delete - Deletes the
wasm_ref_t
. - wasm_
ref_ get_ host_ info - Returns the host information of the
wasm_ref_t
. - wasm_
ref_ same - Returns
true
if bothwasm_ref_t
references are referencing the same objects. - wasm_
ref_ set_ host_ info - Sets the host information of the
wasm_ref_t
toinfo
. - wasm_
ref_ set_ host_ info_ with_ finalizer - Sets the host information of the
wasm_ref_t
toinfo
with the associatedfinalizer
. - wasm_
shared_ module_ delete - Deletes the
wasm_shared_module_t
. - wasm_
store_ delete - Deletes the
wasm_store_t
. - wasm_
store_ new - Creates a new
Store<()>
for the givenengine
. - wasm_
table_ as_ extern - Returns the
wasm_table_t
as mutable reference towasm_extern_t
. - wasm_
table_ as_ extern_ const - Returns the
wasm_table_t
as shared reference towasm_extern_t
. - wasm_
table_ as_ ref - Returns the
wasm_table_t
as mutable reference. - wasm_
table_ as_ ref_ const - Returns the
wasm_table_t
as immutable reference. - wasm_
table_ copy - Creates a new
wasm_table_t
which matches the provided one. - wasm_
table_ delete - Deletes the
wasm_table_t
. - wasm_
table_ ⚠get - Returns the element at
index
ofwasm_table_t
t
. - wasm_
table_ get_ host_ info - Returns the host information of the
wasm_table_t
. - wasm_
table_ ⚠grow - Grows the number of cells of the
wasm_table_t
bydelta
. - wasm_
table_ ⚠new - Creates a new
wasm_table_t
from the givenwasm_tabletype_t
. - wasm_
table_ same - Returns
true
if the given references are pointing to the samewasm_table_t
. - wasm_
table_ ⚠set - Sets the value of the element at
index
ofwasm_table_t
tonew_value
. - wasm_
table_ set_ host_ info - Sets the host information of the
wasm_table_t
. - wasm_
table_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_table_t
. - wasm_
table_ ⚠size - Returns the number of cells of the
wasm_table_t
. - wasm_
table_ ⚠type - Returns the
wasm_tabletype_t
of thewasm_table_t
. - wasm_
tabletype_ as_ externtype - Returns a mutable reference to the element type of
wasm_tabletype_t
aswasm_externtype_t
. - wasm_
tabletype_ as_ externtype_ const - Returns a shared reference to the element type of
wasm_tabletype_t
aswasm_externtype_t
. - wasm_
tabletype_ copy - Creates a new
wasm_tabletype_t
which matches the provided one. - wasm_
tabletype_ delete - Deletes the
wasm_tabletype_t
. - wasm_
tabletype_ element - Returns a shared reference to the element type of the
wasm_tabletype_t
. - wasm_
tabletype_ limits - Returns a shared reference to the table limits of the
wasm_tabletype_t
. - wasm_
tabletype_ new - Creates a new
wasm_tabletype_t
with the elementty
andlimits
. - wasm_
tabletype_ vec_ copy - Copies the
wasm_tabletype_vec_t
insrc
. - wasm_
tabletype_ vec_ delete - Frees memory associated to the
wasm_tabletype_vec_t
. - wasm_
tabletype_ ⚠vec_ new - Creates an new
wasm_tabletype_vec_t
with the givensize
andptr
data. - wasm_
tabletype_ vec_ new_ empty - Creates an empty
wasm_tabletype_vec_t
- wasm_
tabletype_ vec_ new_ uninitialized - Creates an uninitialized
wasm_tabletype_vec_t
with the givensize
. - wasm_
trap_ as_ ref - Returns the
wasm_trap_t
as mutable reference. - wasm_
trap_ as_ ref_ const - Returns the
wasm_trap_t
as immutable reference. - wasm_
trap_ copy - Creates a new
wasm_trap_t
which matches the provided one. - wasm_
trap_ delete - Deletes the
wasm_trap_t
. - wasm_
trap_ get_ host_ info - Returns the host information of the
wasm_trap_t
. - wasm_
trap_ message - Returns the error message of the
wasm_trap_t
. - wasm_
trap_ new - Creates a new
wasm_trap_t
for thewasm_store_t
with the givenmessage
. - wasm_
trap_ origin - Returns the origin of the
wasm_trap_t
if any. - wasm_
trap_ same - Returns
true
if the given references are pointing to the samewasm_trap_t
. - wasm_
trap_ set_ host_ info - Sets the host information of the
wasm_trap_t
. - wasm_
trap_ set_ host_ info_ with_ finalizer - Sets the host information finalizer of the
wasm_trap_t
. - wasm_
trap_ trace - Returns the trace of the
wasm_trap_t
. - wasm_
val_ ⚠copy - Copies the
wasm_val_t
and stores the result inout
. - wasm_
val_ ⚠delete - Deletes the
wasm_val_t
. - wasm_
val_ vec_ copy - Copies the
wasm_val_vec_t
insrc
. - wasm_
val_ vec_ delete - Frees memory associated to the
wasm_val_vec_t
. - wasm_
val_ ⚠vec_ new - Creates an new
wasm_val_vec_t
with the givensize
andptr
data. - wasm_
val_ vec_ new_ empty - Creates an empty
wasm_val_vec_t
- wasm_
val_ vec_ new_ uninitialized - Creates an uninitialized
wasm_val_vec_t
with the givensize
. - wasm_
valtype_ copy - Creates a new
wasm_valtype_t
which matches the provided one. - wasm_
valtype_ delete - Deletes the
wasm_valtype_t
. - wasm_
valtype_ kind - Returns the
wasm_valkind_t
of thewasm_valtype_t
. - wasm_
valtype_ new - Creates a new owned
wasm_valtype_t
from thewasm_valkind_t
. - wasm_
valtype_ vec_ copy - Copies the
wasm_valtype_vec_t
insrc
. - wasm_
valtype_ vec_ delete - Frees memory associated to the
wasm_valtype_vec_t
. - wasm_
valtype_ ⚠vec_ new - Creates an new
wasm_valtype_vec_t
with the givensize
andptr
data. - wasm_
valtype_ vec_ new_ empty - Creates an empty
wasm_valtype_vec_t
- wasm_
valtype_ vec_ new_ uninitialized - Creates an uninitialized
wasm_valtype_vec_t
with the givensize
. - wasmi_
config_ compilation_ mode_ set - Sets the compilation mode for the config.
- wasmi_
config_ consume_ fuel_ set - Enables or disables fuel consumption for the config.
- wasmi_
config_ floats_ set - Enables or disables support for floating point numbers for the config.
- wasmi_
config_ ignore_ custom_ sections_ set - Enables or disables processing of Wasm custom sections.
- wasmi_
config_ wasm_ bulk_ memory_ set - Enables or disables support for the Wasm
bulk-memory-operations
proposal. - wasmi_
config_ wasm_ extended_ const_ set - Enables or disables support for the Wasm
extended-const
proposal. - wasmi_
config_ wasm_ multi_ value_ set - Enables or disables support for the Wasm
multi-value
proposal. - wasmi_
config_ wasm_ mutable_ globals_ set - Enables or disables support for the Wasm
mutable-global
proposal. - wasmi_
config_ wasm_ reference_ types_ set - Enables or disables support for the Wasm
reference-types
proposal. - wasmi_
config_ wasm_ saturating_ float_ to_ int_ set - Enables or disables support for the Wasm
nontrapping-float-to-int-conversions
proposal. - wasmi_
config_ wasm_ sign_ extension_ set - Enables or disables support for the Wasm
sign-extension-ops
proposal. - wasmi_
config_ wasm_ tail_ call_ set - Enables or disables support for the Wasm
tail-call
proposal. - wasmi_
context_ get_ data - Returns a pointer to the foreign data of the Wasmi store context.
- wasmi_
context_ get_ fuel - Returns the current fuel of the Wasmi store context in
fuel
. - wasmi_
context_ set_ data - Sets the foreign data of the Wasmi store context.
- wasmi_
context_ set_ fuel - Sets the current fuel of the Wasmi store context to
fuel
. - wasmi_
engine_ clone - Clones a
wasm_engine_t
. - wasmi_
error_ delete - Deletes the
wasmi_error_t
. - wasmi_
error_ new - Creates a new
wasmi_error_t
with the given error message. - wasmi_
store_ context - Returns mutable access to the store context of the
wasmi_store_t
. - wasmi_
store_ delete - Deletes the
wasmi_store_t
. - wasmi_
store_ new - Creates a new
Store<()>
for the givenengine
. - wasmi_
trap_ ⚠new - Creates a new
wasm_trap_t
from the givenmessage
andlen
pair.
Type Aliases§
- wasm_
func_ callback_ t - A Wasm host function callback.
- wasm_
func_ callback_ with_ env_ t - A Wasm host function callback with access to environmental data.
- wasm_
memory_ pages_ t - Type specifying the number of pages of a Wasm linear memory.
- wasm_
message_ t - A Wasm error message string buffer.
- wasm_
name_ t - A Wasm name string buffer.
- wasm_
table_ size_ t - Type specifying the number of cells of a Wasm table.
Unions§
- wasm_
val_ union - The underlying data of a
wasm_val_t
.