Skip to main content

forge_ir_bindgen/
bindings.rs

1//! `wasmtime::component::bindgen!`-generated bindings for both worlds.
2//!
3//! The two worlds share the `host-api` import and the `types` interface.
4//! Bindgen still emits separate Rust modules per world, so we call the macro
5//! twice. The conversions in [`super::convert`] cover both module hierarchies.
6
7#![allow(clippy::all)]
8#![allow(missing_docs)]
9#![allow(missing_debug_implementations)]
10
11pub mod transformer {
12    wasmtime::component::bindgen!({
13        path: "wit",
14        world: "ir-transformer",
15        imports: { default: trappable },
16    });
17}
18
19pub mod generator {
20    wasmtime::component::bindgen!({
21        path: "wit",
22        world: "code-generator",
23        imports: { default: trappable },
24    });
25}
26
27// Convenience aliases — the imported interfaces are byte-identical between
28// the two worlds, so we point at the transformer world's modules. Host-api
29// and stage are imports; types is a shared interface.
30pub use transformer::forge::plugin::host_api;
31pub use transformer::forge::plugin::stage;
32pub use transformer::forge::plugin::types;