Skip to main content

weaveffi_model/
lib.rs

1//! The WeaveFFI API model: everything between an API definition and code
2//! generation.
3//!
4//! * [`ir`] holds the in-memory IR types that an IDL document or annotated
5//!   Rust source lowers to, and [`parse`] reads the IDL text formats (YAML,
6//!   JSON, and TOML).
7//! * [`rust`] extracts the IR from annotated Rust source for the
8//!   proc-macros.
9//! * [`validate`] checks a document against the library's
10//!   [`Identity`](pkg::Identity) and builds the one [`Model`](model::Model)
11//!   every generator consumes.
12//! * [`ty`], [`model`], [`abi`], [`plan`], [`errors`], and [`pkg`] hold the
13//!   resolved types and type index, the model with every C symbol and ABI
14//!   signature, the C ABI lowering, the marshalling plan, the error naming
15//!   policy, and the package identity.
16//! * [`contract`] computes each top-level module's contract table, one
17//!   fingerprint per declaration, so a stale binding refuses to load and
18//!   names what changed.
19//! * [`meta`] is the library metadata: the frames the macro embeds in a
20//!   producer's library and the CLI reads back into an [`Api`](ir::Api).
21//!
22//! # Features
23//!
24//! * `idl` (default): the IDL text formats, JSON Schema derivation for the IR
25//!   types, and fancy miette diagnostics. Without it the crate still provides
26//!   the IR types, Rust extraction, validation, and the model, which is all
27//!   the proc-macros need.
28#![deny(missing_docs)]
29#![warn(clippy::missing_errors_doc)]
30#![warn(clippy::missing_panics_doc)]
31#![warn(clippy::doc_markdown)]
32// A few docs link to IDL-only items (the `parse` module, miette's
33// `Diagnostic`); those links only resolve with the `idl` feature.
34#![cfg_attr(not(feature = "idl"), allow(rustdoc::broken_intra_doc_links))]
35
36pub mod abi;
37pub mod contract;
38pub mod errors;
39pub mod ir;
40pub mod meta;
41pub mod model;
42#[cfg(feature = "idl")]
43pub mod parse;
44pub mod pkg;
45pub mod plan;
46pub mod rust;
47pub mod ty;
48pub mod validate;