NumericConversion

Trait NumericConversion 

Source
pub trait NumericConversion<T> {
    // Required methods
    fn to_number(self) -> Number;
    fn from_number(n: Number) -> T;
}
Expand description

Type conversion utilities for different numeric types

Required Methods§

Source

fn to_number(self) -> Number

Convert from the source type to Number

Source

fn from_number(n: Number) -> T

Convert from Number to the target type

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.

Implementations on Foreign Types§

Source§

impl NumericConversion<f32> for f32

Source§

impl NumericConversion<i32> for i32

Implementors§