Trait ConversionFactor

Source
pub trait ConversionFactor<V>:
    PartialOrd
    + Add<Self, Output = Self>
    + Sub<Self, Output = Self>
    + Mul<Self, Output = Self>
    + Div<Self, Output = Self>
    + Zero
    + One {
    // Required methods
    fn powi(self, e: i32) -> Self;
    fn value(self) -> V;
}
Expand description

Trait representing a conversion factor.

§Generic Parameters

  • V: Underlying storage type trait is implemented for.

Required Methods§

Source

fn powi(self, e: i32) -> Self

Raises a ConversionFactor<V> to an integer power.

Source

fn value(self) -> V

Converts a ConversionFactor<V> into its underlying storage 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 ConversionFactor<f32> for f32

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> Self

Source§

impl ConversionFactor<f64> for f64

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> Self

Source§

impl ConversionFactor<i32> for Ratio<i32>

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> i32

Source§

impl ConversionFactor<i64> for Ratio<i64>

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> i64

Source§

impl ConversionFactor<isize> for Ratio<isize>

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> isize

Source§

impl ConversionFactor<u32> for Ratio<u32>

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> u32

Source§

impl ConversionFactor<u64> for Ratio<u64>

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> u64

Source§

impl ConversionFactor<usize> for Ratio<usize>

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> usize

Source§

impl ConversionFactor<BigInt> for Ratio<BigInt>

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> BigInt

Source§

impl ConversionFactor<BigUint> for Ratio<BigUint>

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> BigUint

Source§

impl ConversionFactor<Ratio<i32>> for Rational32

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> Rational32

Source§

impl ConversionFactor<Ratio<i64>> for Rational64

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> Rational64

Source§

impl ConversionFactor<Ratio<BigInt>> for BigRational

Source§

fn powi(self, e: i32) -> Self

Source§

fn value(self) -> BigRational

Implementors§