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
Storeis used to implement thewasm.hAPI. *mut wasm_ref_tis a reference type (externreforfuncref), as seen by the C API. Because we do not have a uniform representation forfuncrefs andexternrefs, a*mut wasm_ref_tis morally aOption<Box<Either<ExternRef, Func>>>.- Representation of a
Storeforwasmtime.hThis 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 lessunsafein the implementation.