pub trait NumericValue: Sized {
// Required methods
fn try_to_decimal(&self) -> Option<Decimal>;
fn try_from_decimal(value: Decimal) -> Option<Self>;
}Expand description
Fallible numeric round-trip contract used by generic validators and normalizers.
Implementors convert through Decimal so typed numeric policy stays
explicit and local. Database evaluation semantics remain under db::numeric.
Required Methods§
Sourcefn try_to_decimal(&self) -> Option<Decimal>
fn try_to_decimal(&self) -> Option<Decimal>
Convert this value into Decimal for generic numeric handling.
Sourcefn try_from_decimal(value: Decimal) -> Option<Self>
fn try_from_decimal(value: Decimal) -> Option<Self>
Rebuild the value from Decimal after generic numeric handling.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".