pub struct AnalyzedSpecRegistry {
yaml: SpecRegistry,
derived: BTreeMap<String, DerivedSpec>,
}Expand description
A layered spec registry that combines immutable YAML-authored specs with mutable analysis-derived overlays.
Consumers query via lookup(), which returns both the YAML spec (if any)
and the derived overlay (if any).
Fields§
§yaml: SpecRegistryImmutable YAML-authored specs.
derived: BTreeMap<String, DerivedSpec>Analysis-derived overlay, keyed by function name.
Implementations§
Source§impl AnalyzedSpecRegistry
impl AnalyzedSpecRegistry
Sourcepub fn new(yaml: SpecRegistry) -> Self
pub fn new(yaml: SpecRegistry) -> Self
Create a new layered registry wrapping existing YAML specs.
Sourcepub fn add_derived(&mut self, name: &str, spec: DerivedSpec)
pub fn add_derived(&mut self, name: &str, spec: DerivedSpec)
Add an analysis-derived spec overlay for a function.
Sourcepub fn lookup(&self, name: &str) -> Option<LookupResult<'_>>
pub fn lookup(&self, name: &str) -> Option<LookupResult<'_>>
Look up a function by name. Returns the YAML spec and/or derived overlay.
Returns None if neither YAML nor derived spec exists for this name.
Sourcepub fn lookup_derived(&self, name: &str) -> Option<&DerivedSpec>
pub fn lookup_derived(&self, name: &str) -> Option<&DerivedSpec>
Look up only the derived overlay for a function.
Sourcepub fn lookup_yaml(&self, name: &str) -> Option<&FunctionSpec>
pub fn lookup_yaml(&self, name: &str) -> Option<&FunctionSpec>
Look up only the YAML spec for a function (delegates to inner registry).
Sourcepub fn yaml(&self) -> &SpecRegistry
pub fn yaml(&self) -> &SpecRegistry
Access the underlying YAML registry.
Sourcepub fn iter_yaml(&self) -> impl Iterator<Item = &FunctionSpec>
pub fn iter_yaml(&self) -> impl Iterator<Item = &FunctionSpec>
Iterate all YAML specs (delegates to inner registry).
Sourcepub fn iter_derived(&self) -> impl Iterator<Item = (&str, &DerivedSpec)>
pub fn iter_derived(&self) -> impl Iterator<Item = (&str, &DerivedSpec)>
Iterate all derived specs.
Sourcepub fn derived_count(&self) -> usize
pub fn derived_count(&self) -> usize
Number of derived overlay entries.