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; the proc-macros and
8//!   the CLI share it.
9//! * [`validate`] checks a document and produces the [`ResolvedApi`] every
10//!   consumer works from.
11//! * [`model`], [`abi`], [`plan`], [`errors`], and [`pkg`] build the canonical
12//!   binding model, the C ABI lowering, the marshalling plan, the error
13//!   mapping, and the package identity.
14//! * [`checksum`] fingerprints each top-level module's contract so a stale
15//!   binding refuses to load.
16//!
17//! # Features
18//!
19//! * `idl` (default): the IDL text formats, JSON Schema derivation for the IR
20//!   types, and fancy miette diagnostics. Without it the crate still provides
21//!   the IR types, Rust extraction, validation, and the binding model, which
22//!   is all the proc-macros need.
23#![deny(missing_docs)]
24#![warn(clippy::missing_errors_doc)]
25#![warn(clippy::missing_panics_doc)]
26#![warn(clippy::doc_markdown)]
27// A few docs link to IDL-only items (the `parse` module, miette's
28// `Diagnostic`); those links only resolve with the `idl` feature.
29#![cfg_attr(not(feature = "idl"), allow(rustdoc::broken_intra_doc_links))]
30
31pub mod abi;
32pub mod checksum;
33pub mod errors;
34pub mod ir;
35pub mod model;
36#[cfg(feature = "idl")]
37pub mod parse;
38pub mod pkg;
39pub mod plan;
40pub mod resolved;
41pub mod rust;
42pub mod validate;
43
44pub use resolved::ResolvedApi;