pub(crate) trait DecimalCast: Sized {
// Required methods
fn to_i128(self) -> Option<i128>;
fn to_i256(self) -> Option<i256>;
fn from_decimal<T: DecimalCast>(n: T) -> Option<Self>;
fn from_f64(n: f64) -> Option<Self>;
}
Expand description
A utility trait that provides checked conversions between
decimal types inspired by NumCast
Required Methods§
fn to_i128(self) -> Option<i128>
fn to_i256(self) -> Option<i256>
fn from_decimal<T: DecimalCast>(n: T) -> Option<Self>
fn from_f64(n: f64) -> Option<Self>
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.