EvalexprNumericTypes

Trait EvalexprNumericTypes 

Source
pub trait EvalexprNumericTypes:
    'static
    + Sized
    + Debug
    + Clone
    + PartialEq {
    type Int: EvalexprInt<Self>;
    type Float: EvalexprFloat<Self>;

    // Required methods
    fn int_as_float(int: &Self::Int) -> Self::Float;
    fn float_as_int(float: &Self::Float) -> Self::Int;
}
Expand description

A trait to parameterise evalexpr with an int type and a float type.

See EvalexprInt and EvalexprFloat for the requirements on the types.

Required Associated Types§

Source

type Int: EvalexprInt<Self>

The integer type.

Source

type Float: EvalexprFloat<Self>

The float type.

Required Methods§

Source

fn int_as_float(int: &Self::Int) -> Self::Float

Convert an integer to a float using the as operator or a similar mechanic.

Source

fn float_as_int(float: &Self::Float) -> Self::Int

Convert a float to an integer using the as operator or a similar mechanic.

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.

Implementors§