Expand description
Contract tables: the per-declaration fingerprints a consumer checks when it loads the library.
The #[weaveffi::module] expansion exports, for each top-level module
m, const {prefix}_contract_entry* {prefix}_{m}_contract(size_t* out_len), returning a static table of ContractEntry values sorted by
id: one per declaration (function, interface and each of its members,
record, enum, callback interface, and error domain) in m and its
submodules. The expansion computes every entry at compile time and keeps
only those whose #[cfg] holds, using contract_len and
contract_compact in constant context, so the table reflects exactly
what the build exports.
Structs§
- Contract
Entry - One declaration’s fingerprint (
{prefix}_contract_entryin C).
Functions§
- contract_
compact - The enabled entries of
entries, in order.Mmust becontract_lenofentries. - contract_
len - How many of
entriesare enabled (their flag istrue). - contract_
table ⚠ - The body of
{prefix}_{module}_contract: write the table’s length toout_lenand return its first entry (null for an empty table).