Trait DecimalCast
pub trait DecimalCast: Sized {
// Required methods
fn to_i32(self) -> Option<i32>;
fn to_i64(self) -> Option<i64>;
fn to_i128(self) -> Option<i128>;
fn to_i256(self) -> Option<i256>;
fn from_decimal<T>(n: T) -> Option<Self>
where T: DecimalCast;
fn from_f64(n: f64) -> Option<Self>;
// Provided method
fn mul_checked_opt(self, rhs: Self) -> Option<Self>
where Self: ArrowNativeTypeOp { ... }
}Expand description
A utility trait that provides checked conversions between
decimal types inspired by NumCast
Required Methods§
fn from_decimal<T>(n: T) -> Option<Self>where
T: DecimalCast,
fn from_decimal<T>(n: T) -> Option<Self>where
T: DecimalCast,
Convert a decimal from a decimal
Provided Methods§
fn mul_checked_opt(self, rhs: Self) -> Option<Self>where
Self: ArrowNativeTypeOp,
fn mul_checked_opt(self, rhs: Self) -> Option<Self>where
Self: ArrowNativeTypeOp,
Multiply, returning None on overflow
Unlike ArrowNativeTypeOp::mul_checked, this does not build an error
message, which keeps per-value closures small enough to inline.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".