pub fn resolve_selector(name: &str) -> Result<Metric, UnknownSelectorError>Expand description
Resolve a metric selector to the Metric family that computes it.
A selector is any name bca metrics --metrics accepts:
- a family name (
loc,cyclomatic), theMetricDisplayspelling; - a
bca list-metricsrow name (sloc,dloc, …), which selects the family that owns the row; - a dotted
METRICSid (cyclomatic.modified,loc.sloc,mi.original), which selects its family.
Selection is family-granular, as the walk computes whole families:
"dloc" and "loc" both select Metric::Loc, and nothing narrows
the output to the named field. Matching is strict lowercase, like
Metric’s FromStr.
§Errors
UnknownSelectorError when name is none of the above. It carries
the closest selector_names as a did-you-mean hint.