Skip to main content

Module extractor

Module extractor 

Source
Expand description

Per-language extractor contract.

Every supported language exposes a zero-sized Lang type implementing LangExtractor. The trait carries no dispatch overhead — it is the formal contract every extractor must satisfy.

assert_conformance::<Lang>(graph, anchor) validates that a graph produced by an extractor respects the contract. Each extractor’s #[cfg(test)] extract_default helper invokes it on every fixture.

The trait also exposes declare / to_spec default impls that delegate to declare::* after validating the spec/graph carries this language’s LANG_TAG. The dynamic-dispatch SQL entry points (code_graph_declare, code_graph_to_spec) keep using the free functions in declare; the typed methods on the trait give Rust callers a compile-time-typed handle to the same lifecycle.

Traits§

LangExtractor