Skip to main content

NumericSize

Trait NumericSize 

Source
pub trait NumericSize:
    Clone
    + Default
    + PartialOrd
    + Num
    + Zero
    + Bounded
    + AddAssign
    + 'static {
    // Required methods
    fn checked_add_value(
        self,
        other: Self,
    ) -> Result<Self, NumericArithmeticError>;
    fn checked_mul_value(
        self,
        other: Self,
    ) -> Result<Self, NumericArithmeticError>;
}
Expand description

Bound for objective value types (i64, f64, etc.)

Required Methods§

Source

fn checked_add_value(self, other: Self) -> Result<Self, NumericArithmeticError>

Add two values when the exact result remains representable and finite.

Source

fn checked_mul_value(self, other: Self) -> Result<Self, NumericArithmeticError>

Multiply two values when the exact result remains representable and finite.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NumericSize for f64

Source§

impl NumericSize for i64

Source§

impl NumericSize for u64

Source§

impl NumericSize for usize

Implementors§