Skip to main content

Crate weaveffi_model

Crate weaveffi_model 

Source
Expand description

The WeaveFFI API model: everything between an API definition and code generation.

  • ir holds the in-memory IR types that an IDL document or annotated Rust source lowers to, and parse reads the IDL text formats (YAML, JSON, and TOML).
  • rust extracts the IR from annotated Rust source; the proc-macros and the CLI share it.
  • validate checks a document and produces the ResolvedApi every consumer works from.
  • model, abi, plan, errors, and pkg build the canonical binding model, the C ABI lowering, the marshalling plan, the error mapping, and the package identity.
  • checksum fingerprints each top-level module’s contract so a stale binding refuses to load.

§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 binding model, which is all the proc-macros need.

Re-exports§

pub use resolved::ResolvedApi;

Modules§

abi
The canonical WeaveFFI C ABI model.
checksum
Contract checksums: a stable fingerprint of a 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.
model
The binding model: a normalized, fully-lowered view of a ResolvedApi 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.
resolved
The resolved IR: a validated Api paired with the type index that turns its written TypeRefs into resolved Tys.
rust
Extract a WeaveFFI Api from annotated Rust source.
validate
IDL validation. This module owns the ValidationError catalog and the validate_api entry point; the work is split across submodules: rules (per-module checks), diagnostic (miette span attachment), and warnings (advisory lints).