Expand description
Runtime types for the api-parity-rs port plugin.
§How it works
- Source code is annotated with
#[parity_impl](onimplblocks) or#[parity(...)](on free functions). Those macros live inapi-parity-rs-macrosand are re-exported below. - Each annotation expands to an
inventory::submit! { ParityEntry { ... } }call. Theinventorycrate uses link-time registration: eachsubmit!drops a static into a special section, andinventory::iter::<T>()walks them at runtime. No central registry, no init order, and the stub fn the attribute is attached to never has to be called for the entry to be registered. - A target-crate binary calls
dump_to_writer(gated on theserdefeature) to serialize the registered entries as akind=portenvelope (perSCHEMA.md) forapi-parityto consume.
The crate is intentionally domain-agnostic: ParityEntry::path is
just an opaque string. It can name a PySpark API, a REST endpoint, etc.
Re-exports§
pub use inventory;
Structs§
- Parity
Entry - One row in the port-side inventory. All fields are
&'static strso the struct can be built ininventory::submit!(which requires aconst-constructible value).
Enums§
- Status
- Implementation state of a tracked API.
Attribute Macros§
- parity
- Attribute on a free
fn. Used when there’s no enclosing impl block to provide a type prefix; the implementation path becomesmodule_path!()::fn_name(resolved at compile time of the user crate, sincemodule_path!()expands in place). - parity_
impl - Attribute on an
implblock. Walks the block’s methods, strips any#[parity(...)]attributes, and emits oneinventory::submit!per stripped attribute. The implementation path isSelf::fn_name, so the type prefix is auto-derived (the user doesn’t have to repeat it).