Expand description
The WeaveFFI API model: everything between an API definition and code generation.
irholds the in-memory IR types that an IDL document or annotated Rust source lowers to, andparsereads the IDL text formats (YAML, JSON, and TOML).rustextracts the IR from annotated Rust source for the proc-macros.validatechecks a document against the library’sIdentityand builds the oneModelevery generator consumes.ty,model,abi,plan,errors, andpkghold the resolved types and type index, the model with every C symbol and ABI signature, the C ABI lowering, the marshalling plan, the error naming policy, and the package identity.contractcomputes each top-level module’s contract table, one fingerprint per declaration, so a stale binding refuses to load and names what changed.metais the library metadata: the frames the macro embeds in a producer’s library and the CLI reads back into anApi.
§Features
idl(default): the IDL text formats, JSON Schema derivation for the IR types, and fancy miette diagnostics. Without it the crate still provides the IR types, Rust extraction, validation, and the model, which is all the proc-macros need.
Modules§
- abi
- The canonical WeaveFFI C ABI lowering.
- contract
- Contract tables: a per-declaration fingerprint of each top-level module’s ABI.
- errors
- The shared error naming policy.
- ir
- In-memory intermediate representation: the data model a parsed WeaveFFI IDL document becomes.
- meta
- Library metadata: the API a Rust producer embeds in its compiled library.
- model
- The model: the one validated, fully lowered view of an API that every language backend consumes.
- parse
- Multi-format IDL parsing: turn YAML, JSON, or TOML source text into an
Api. - pkg
- Package identity: the one source of every name a generated package uses.
- plan
- The marshalling plan: the language-neutral calling contracts every backend renders, stated once.
- rust
- Extract the IR of a
#[weaveffi::module]tree from its Rust syntax. - ty
- The resolved type every backend consumes, the single taxonomy that
classifies it for the C ABI and the value-buffer wire format, and the
TypeIndexthat maps each user type name to its declaration. - validate
- IDL validation. This module owns the
ValidationErrorcatalog and thevalidateentry point, which checks anApiagainst the library’sIdentityand builds the oneModelevery generator consumes. The work is split across submodules:rules(name, type, and shape checks),diagnostic(miette span attachment), andwarnings(advisory lints).