pub trait WeightElement:
Clone
+ Default
+ 'static {
type Sum: NumericSize;
const IS_UNIT: bool;
// Required method
fn to_sum(&self) -> Self::Sum;
}Expand description
Maps a weight element to its sum/metric type.
This decouples the per-element weight type from the accumulation type.
For concrete weights (i32, f64), Sum is the same type.
For the unit weight One, Sum = i32.
Required Associated Constants§
Required Associated Types§
Sourcetype Sum: NumericSize
type Sum: NumericSize
The numeric type used for sums and comparisons.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.