Crate wasmtime_c_api
source ·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. *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.