Expand description
This crate is the implementation of Wasmtime’s C API.
This crate is normally not intended to be used from Rust itself. For that,
see the wasmtime
crate. It is possible to use this crate via Cargo, for
Rust crates that wrap C libraries that use wasmtime. Most often, this crate
is compiled as a cdylib or staticlib, via the wasmtime-c-api
crate.
Documentation for this crate largely lives in the header
files of the include
directory for this crate.
At a high level this crate implements the wasm.h
API with some gymnastics,
but otherwise an accompanying wasmtime.h
API is provided which is more
specific to Wasmtime and has fewer gymnastics to implement.
Re-exports§
pub use wasmtime;
Structs§
- Helper for running a C-defined finalizer over some data when the Rust structure is dropped.
- This representation of a
Store
is used to implement thewasm.h
API (and not thewasmtime.h
API!) *mut wasm_ref_t
is a reference type (externref
orfuncref
), as seen by the C API. Because we do not have a uniform representation forfuncref
s andexternref
s, a*mut wasm_ref_t
is morally aOption<Box<Either<ExternRef, Func>>>
.- Representation of a
Store
forwasmtime.h
This notably tries to move more burden of aliasing on the caller rather than internally, allowing for a more raw representation of contexts and such that requires lessunsafe
in the implementation.
Enums§
Constants§
Functions§
- Deletes the
wasm_config_t
. - Deletes the
wasm_engine_t
. - Creates a new
wasm_exporttype_t
which matches the provided one. - Deletes the
wasm_exporttype_t
. - Returns the
wasm_extern_t
as mutable reference. - Returns the
wasm_extern_t
as immutable reference. - 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
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
. - Creates a new
wasm_externtype_t
which matches the provided one. - Deletes the
wasm_externtype_t
. - 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
. - 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
. - Deletes the
wasm_frame_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
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
. - Creates a new
wasm_functype_t
which matches the provided one. - Deletes the
wasm_functype_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 host information of the
wasm_global_t
. - Returns
true
if the given references are pointing to the samewasm_global_t
. - Sets the host information of the
wasm_global_t
. - Sets the host information finalizer of the
wasm_global_t
. - Creates a new
wasm_globaltype_t
which matches the provided one. - Deletes the
wasm_globaltype_t
. - Creates a new
wasm_importtype_t
which matches the provided one. - Deletes the
wasm_importtype_t
. - 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 host information of the
wasm_instance_t
. - 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. - Returns the
wasm_memory_t
as immutable reference. - Creates a new
wasm_memory_t
which matches the provided one. - Deletes the
wasm_memory_t
. - Returns the host information of the
wasm_memory_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
. - Creates a new
wasm_memorytype_t
which matches the provided one. - Deletes the
wasm_memorytype_t
. - 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
. - Returns the host information of the
wasm_module_t
. - Returns
true
if the given references are pointing to the samewasm_module_t
. - Sets the host information of the
wasm_module_t
. - Sets the host information finalizer of the
wasm_module_t
. - Deletes the
wasm_ref_t
. - Deletes the
wasm_shared_module_t
. - Deletes the
wasm_store_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
. - 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
. - Creates a new
wasm_tabletype_t
which matches the provided one. - Deletes the
wasm_tabletype_t
. - 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
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
. - Creates a new
wasm_valtype_t
which matches the provided one. - Deletes the
wasm_valtype_t
. - Deletes the
wasmtime_error_t
. - Deletes the
wasmtime_linker_t
. - Deletes the
wasmtime_module_t
. - Deletes the
wasmtime_store_t
.