NumDType

Trait NumDType 

Source
pub trait NumDType:
    WithDType
    + Num
    + Bounded
    + Sum
    + Product
    + AddAssign
    + SubAssign
    + MulAssign
    + DivAssign {
    type Category: NumCategory;

    // Required methods
    fn from_f64(v: f64) -> Self;
    fn to_f64(self) -> f64;
    fn from_usize(v: usize) -> Self;
    fn to_usize(self) -> usize;
    fn minimum(lhs: Self, rhs: Self) -> Self;
    fn maximum(lhs: Self, rhs: Self) -> Self;
    fn close(self, other: Self, rtol: f64, atol: f64) -> bool;
    fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>;
}

Required Associated Types§

Required Methods§

Source

fn from_f64(v: f64) -> Self

Source

fn to_f64(self) -> f64

Source

fn from_usize(v: usize) -> Self

Source

fn to_usize(self) -> usize

Source

fn minimum(lhs: Self, rhs: Self) -> Self

Source

fn maximum(lhs: Self, rhs: Self) -> Self

Source

fn close(self, other: Self, rtol: f64, atol: f64) -> bool

Source

fn to_range_storage(start: Self, end: Self) -> Result<Storage<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.

Implementations on Foreign Types§

Source§

impl NumDType for f32

Source§

type Category = FloatCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, rtol: f64, atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Source§

impl NumDType for f64

Source§

type Category = FloatCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, rtol: f64, atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Source§

impl NumDType for i8

Source§

type Category = IntCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, _rtol: f64, _atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Source§

impl NumDType for i16

Source§

type Category = IntCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, _rtol: f64, _atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Source§

impl NumDType for i32

Source§

type Category = IntCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, _rtol: f64, _atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Source§

impl NumDType for u8

Source§

type Category = IntCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, _rtol: f64, _atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Source§

impl NumDType for u16

Source§

type Category = IntCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, _rtol: f64, _atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Source§

impl NumDType for u32

Source§

type Category = IntCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, _rtol: f64, _atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Source§

impl NumDType for usize

Source§

type Category = IntCategory

Source§

fn from_f64(v: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn from_usize(v: usize) -> Self

Source§

fn to_usize(self) -> usize

Source§

fn minimum(lhs: Self, rhs: Self) -> Self

Source§

fn maximum(lhs: Self, rhs: Self) -> Self

Source§

fn close(self, other: Self, _rtol: f64, _atol: f64) -> bool

Source§

fn to_range_storage(start: Self, end: Self) -> Result<Storage<Self>>

Implementors§