Expand description
Conversions between bindgen-generated WIT types and forge_ir.
Both ir-transformer and code-generator worlds share the types,
host-api, and stage interfaces, but wasmtime::component::bindgen!
emits separate Rust modules per world (the types are structurally
identical, nominally distinct). To avoid duplicating ~600 lines of
conversion glue, we expand the conversions once per world via a
macro_rules! macro keyed on the bindings root module.
Public API:
convert::transformer::*— operates oncrate::bindings::transformer::forge::plugin::types::*.convert::generator::*— operates oncrate::bindings::generator::forge::plugin::types::*.
Both submodules expose:
ir_to_wit(forge_ir::Ir) -> b::types::Irir_from_wit(b::types::Ir) -> Result<forge_ir::Ir, BindgenError>diagnostic_from_wit(b::types::Diagnostic) -> Result<forge_ir::Diagnostic, BindgenError>plugin_info_from_wit(b::types::PluginInfo) -> forge_ir::PluginInfostage_error_from_wit(b::stage::StageError) -> StageErrorRepr
StageErrorRepr is a world-independent representation of the WIT
stage-error variant; the host translates it to its own StageError
type to avoid a circular dependency.
Modules§
- generator
- Conversions between
forge_irand thegeneratorworld’s WIT types. - transformer
- Conversions between
forge_irand thetransformerworld’s WIT types.
Enums§
- Resource
Kind Repr - Stage
Error Repr - Host-neutral representation of the WIT
stage-errorvariant. Shared between both worlds; the host wraps it into its ownStageError.