Skip to main content

finite_score_set

Macro finite_score_set 

Source
macro_rules! finite_score_set {
    () => { ... };
    ($($weight:expr => $metric:expr),+ $(,)?) => { ... };
}
Expand description

Declare a finite set of weight => metric pairs (Layer 2).

Metrics are auto-wrapped in an anonymous zero-vtable enum (no explicit finite_metric! declaration needed). For named variants or a Custom escape hatch, use finite_metric! directly.

§Example

let gc  = metric("gc") .measure().by(...).map01().by(...);
let len = metric("len").measure().by(...).map01().by(...);

let set = finite_score_set! {
    2.0 => gc,
    3.0 => len,
}?;

let total = set.sum(&input);