archunit

Function gather_custom_metric_violations

Source
pub fn gather_custom_metric_violations<Calculation, Predicate>(
    type_infos: &[TypeInfo],
    metric_name: &str,
    description: &str,
    calculation: &Calculation,
    predicate: &Predicate,
) -> Vec<CustomMetricViolation>
where Calculation: Fn(&TypeInfo) -> f64, Predicate: Fn(f64, &TypeInfo) -> bool,
Expand description

Calculates and checks one custom metric for every supplied type.

Each callback is invoked exactly once per type in input order. Panics from either user callback propagate normally and are intentionally not converted into architecture violations.