1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use Ordering;
use BigDecimal;
/// Trait for types that can be converted to BigDecimal
///
/// This trait provides a way to convert numeric types to BigDecimal for use in
/// database operations. It's used as a base trait for numeric operations.
/// Trait for types that can be added to a BigDecimal in-place
///
/// This trait enables efficient accumulation by mutating a BigDecimal directly
/// instead of creating intermediate allocations. Types implementing this trait
/// can be used with the `add()` and `sub()` methods on database rows.
///
/// This trait extends `ToBigDecimal` to allow conversion to BigDecimal when needed.
/// 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.