37 lines
1.3 KiB
Rust
37 lines
1.3 KiB
Rust
|
|
/// A statically registered node contribution, submitted at link time.
|
||
|
|
///
|
||
|
|
/// Crates that derive `OntologyNode` emit an
|
||
|
|
/// `inventory::submit!(NodeContribution { ... })` call, which is collected
|
||
|
|
/// here. All submissions are merged into [`Core`] via
|
||
|
|
/// [`Core::merge_contributors`] — NCL-loaded nodes always win on id collision.
|
||
|
|
///
|
||
|
|
/// [`Core`]: crate::ontology::Core
|
||
|
|
pub struct NodeContribution {
|
||
|
|
/// Returns the node to contribute. Called once per contribution during
|
||
|
|
/// merge.
|
||
|
|
pub supplier: fn() -> crate::types::Node,
|
||
|
|
}
|
||
|
|
|
||
|
|
inventory::collect!(NodeContribution);
|
||
|
|
|
||
|
|
/// A statically registered test coverage entry, submitted at test-binary link
|
||
|
|
/// time.
|
||
|
|
///
|
||
|
|
/// Produced by `#[onto_validates(practice = "...", adr = "...")]` from
|
||
|
|
/// `ontoref-derive`. Collected by [`Core::uncovered_practices`] to identify
|
||
|
|
/// practices without test coverage.
|
||
|
|
///
|
||
|
|
/// Only present in test binaries — zero production binary impact because
|
||
|
|
/// `#[cfg(all(test, feature = "derive"))]` gates all `inventory::submit!`
|
||
|
|
/// calls.
|
||
|
|
///
|
||
|
|
/// [`Core::uncovered_practices`]: crate::ontology::Core::uncovered_practices
|
||
|
|
pub struct TestCoverage {
|
||
|
|
/// Practice node id validated by this test, if any.
|
||
|
|
pub practice_id: Option<&'static str>,
|
||
|
|
/// ADR id validated by this test, if any.
|
||
|
|
pub adr_id: Option<&'static str>,
|
||
|
|
}
|
||
|
|
|
||
|
|
inventory::collect!(TestCoverage);
|