pub trait NumericComparable: ToBigDecimal {
// Required method
fn cmp_to_big_decimal(&self, other: &BigDecimal) -> Ordering;
}Expand description
Trait for types that can be compared against a BigDecimal for min/max operations
This trait leverages BigDecimal’s native PartialOrd implementations for primitive types, enabling zero-allocation comparisons for integers.
Required Methods§
Sourcefn cmp_to_big_decimal(&self, other: &BigDecimal) -> Ordering
fn cmp_to_big_decimal(&self, other: &BigDecimal) -> Ordering
Compare self against a BigDecimal value
For primitive integers, this uses BigDecimal’s native PartialOrd implementation which requires no allocation. For other types, conversion may be needed.