pub struct SummaryRegistry {
user_specs: BTreeMap<FunctionId, FunctionSummary>,
computed: BTreeMap<FunctionId, FunctionSummary>,
defaults: BTreeMap<FunctionId, FunctionSummary>,
}Expand description
Unified registry for function summaries with three-tier priority lookup.
When looking up a function, the registry checks each tier in order: user specs > computed > defaults. The first match wins.
Fields§
§user_specs: BTreeMap<FunctionId, FunctionSummary>User-edited YAML specs converted to summaries (highest priority).
computed: BTreeMap<FunctionId, FunctionSummary>Analysis-computed summaries.
defaults: BTreeMap<FunctionId, FunctionSummary>Default shipped specs converted to summaries (lowest priority).
Implementations§
Source§impl SummaryRegistry
impl SummaryRegistry
Sourcepub fn get(&self, id: &FunctionId) -> Option<&FunctionSummary>
pub fn get(&self, id: &FunctionId) -> Option<&FunctionSummary>
Look up a summary with priority: user > computed > default.
Returns the highest-priority summary for the given function, or None
if no summary exists in any tier.
Sourcepub fn insert_computed(&mut self, summary: FunctionSummary)
pub fn insert_computed(&mut self, summary: FunctionSummary)
Insert an analysis-computed summary into the computed tier.
If a computed summary already exists for this function, it is replaced.
Sourcepub fn insert_user(&mut self, summary: FunctionSummary)
pub fn insert_user(&mut self, summary: FunctionSummary)
Insert a user-spec summary into the user tier (highest priority).
If a user summary already exists for this function, it is replaced.
Sourcepub fn insert_default(&mut self, summary: FunctionSummary)
pub fn insert_default(&mut self, summary: FunctionSummary)
Insert a default summary into the defaults tier (lowest priority).
If a default summary already exists for this function, it is replaced.
Sourcepub fn load_specs(&mut self, registry: &SpecRegistry)
pub fn load_specs(&mut self, registry: &SpecRegistry)
Load all exact-match specs from a SpecRegistry and convert them to
summaries in the defaults tier.
Each spec is converted via FunctionSummary::from_spec with a
FunctionId derived from the spec’s name. Pattern-based specs are
skipped (they require runtime name resolution at call sites).
Sourcepub fn load_user_specs(&mut self, registry: &SpecRegistry)
pub fn load_user_specs(&mut self, registry: &SpecRegistry)
Load all exact-match specs from a SpecRegistry into the user tier.
Same as load_specs but inserts into the
highest-priority user tier.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Get the total number of summaries across all tiers.
Note: if the same function appears in multiple tiers, it is counted
multiple times. Use unique_count for deduplicated count.
Sourcepub fn unique_count(&self) -> usize
pub fn unique_count(&self) -> usize
Get the number of unique functions with at least one summary.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&FunctionId, &FunctionSummary)>
pub fn iter(&self) -> impl Iterator<Item = (&FunctionId, &FunctionSummary)>
Iterate over all unique function IDs, yielding the highest-priority summary for each.
Sourcepub fn computed_count(&self) -> usize
pub fn computed_count(&self) -> usize
Get the number of summaries in the computed tier.
Sourcepub fn user_count(&self) -> usize
pub fn user_count(&self) -> usize
Get the number of summaries in the user tier.
Sourcepub fn defaults_count(&self) -> usize
pub fn defaults_count(&self) -> usize
Get the number of summaries in the defaults tier.
Trait Implementations§
Source§impl Clone for SummaryRegistry
impl Clone for SummaryRegistry
Source§fn clone(&self) -> SummaryRegistry
fn clone(&self) -> SummaryRegistry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more