[][src]Enum fraction::prelude::GenericFraction

pub enum GenericFraction<T> where
    T: Clone + Integer
{ Rational(SignRatio<T>), Infinity(Sign), NaN, }

Generic implementation of the fraction type

Examples

use fraction::GenericFraction;

type F = GenericFraction<u8>;

let first = F::new (1u8, 2u8);
let second = F::new (2u8, 8u8);

assert_eq! (first + second, F::new (3u8, 4u8));

Since GenericFraction keeps its sign explicitly and independently of the numerics, it is not recommended to use signed types, although it's completely valid with the cost of target type capacity.

use fraction::GenericFraction;

type F = GenericFraction<i8>;

let first = F::new (1, 2);
let second = F::new (2, 8);

assert_eq! (first + second, F::new (3, 4));

Variants

Rational(SignRatio<T>)
Infinity(Sign)
NaN

Implementations

impl<T> GenericFraction<T> where
    T: Clone + Integer
[src]

pub fn new_generic<N, D>(
    sign: Sign,
    num: N,
    den: D
) -> Option<GenericFraction<T>> where
    N: GenericInteger + PartialOrd,
    D: GenericInteger + PartialOrd,
    T: GenericInteger
[src]

Constructs a new fraction with the specified numerator and denominator Handles gracefully signed integers even if the storage type is unsigned and vise versa The arguments can be of any integer types imlementing the necessary traits

Examples

use fraction::{GenericFraction, Sign};
type F = GenericFraction<u16>;

let f12 = F::new_generic(Sign::Plus, 1i8, 2u8).unwrap();
let f34 = F::new_generic(Sign::Plus, 3i16, 4u32).unwrap();
let f56 = F::new_generic(Sign::Plus, 5i64, 6u128).unwrap();
let f78 = F::new_generic(Sign::Plus, 7usize, 8isize).unwrap();

assert_eq! ((*f12.numer().unwrap(), *f12.denom().unwrap()), (1u16, 2u16));
assert_eq! ((*f34.numer().unwrap(), *f34.denom().unwrap()), (3u16, 4u16));
assert_eq! ((*f56.numer().unwrap(), *f56.denom().unwrap()), (5u16, 6u16));
assert_eq! ((*f78.numer().unwrap(), *f78.denom().unwrap()), (7u16, 8u16));

pub fn new<N, D>(num: N, den: D) -> GenericFraction<T> where
    N: Into<T>,
    D: Into<T>, 
[src]

Constructs a new fraction with the specified numerator and denominator

The arguments must me either of T type, or implement Into<T> trait.

Examples

use fraction::GenericFraction;
type F = GenericFraction<u16>;

let _f = F::new(1u8, 2u16);

pub fn new_neg<N, D>(num: N, den: D) -> GenericFraction<T> where
    N: Into<T>,
    D: Into<T>, 
[src]

Constructs a new negative fraction with the specified numerator and denominator

The arguments must be either of T type, or implement Into<T> trait.

Examples

use fraction::GenericFraction;
type F = GenericFraction<u16>;

let _f = F::new_neg (1u8, 2u16);

pub fn new_raw(num: T, den: T) -> GenericFraction<T>[src]

Constructs a new fraction without types casting, checking for denom == 0 and reducing numbers.

You must be careful with this function because all the other functionality parts rely on the numbers to be reduced. That said, in the normal case 2/4 has to be reduced to 1/2, but it will not happen with new_raw.

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

let _f = F::new_raw (1u8, 2u8);

pub fn new_raw_neg(num: T, den: T) -> GenericFraction<T>[src]

The same as fn new_raw, but produces negative fractions.

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

let _f = F::new_raw_neg (1u8, 2u8);

pub fn numer(&self) -> Option<&T>[src]

Returns a reference to the numerator value

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

let fra = F::new (5u8, 6u8);
assert_eq! (5, *fra.numer ().unwrap ());

pub fn denom(&self) -> Option<&T>[src]

Returns a reference to the denominator value

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

let fra = F::new (5u8, 6u8);
assert_eq! (6, *fra.denom ().unwrap ());

pub fn sign(&self) -> Option<Sign>[src]

Returns a reference to the sign value

Examples

use fraction::{ GenericFraction, Sign };
type F = GenericFraction<u8>;


let fra = F::new (5u8, 6u8);
assert_eq! (Sign::Plus, fra.sign ().unwrap ());

let fra = F::new_neg (5u8, 6u8);
assert_eq! (Sign::Minus, fra.sign ().unwrap ());


let fra = F::infinity ();
assert_eq! (Sign::Plus, fra.sign ().unwrap ());

let fra = F::neg_infinity ();
assert_eq! (Sign::Minus, fra.sign ().unwrap ());


let fra = F::nan ();
assert_eq! (None, fra.sign ());

pub fn from_fraction<F>(from: GenericFraction<F>) -> GenericFraction<T> where
    T: From<F>,
    F: Clone + Integer
[src]

Generates a GenericFraction from GenericFraction where T: From

use fraction::{ Fraction, GenericFraction };
type F8 = GenericFraction<u8>;

let fra8 = F8::new (5u8, 6u8);
assert_eq! (Fraction::new (5u64, 6u64), Fraction::from_fraction(fra8));

pub fn into_fraction<I>(self) -> GenericFraction<I> where
    T: Into<I>,
    I: Clone + Integer
[src]

Generates a GenericFraction from GenericFraction where T: Into

use fraction::{ Fraction, GenericFraction };
type F8 = GenericFraction<u8>;

let fra8 = F8::new (5u8, 6u8);
assert_eq! (Fraction::new (5u64, 6u64), fra8.into_fraction());

pub fn format_as_decimal(&self, precision: usize) -> Option<String> where
    T: Clone + GenericInteger
[src]

👎 Deprecated:

Use format!("{:.1$}", fraction, precision)

Returns a decimal representation of the fraction

DEPRECATED! Use format!("{:.1$}", fraction, precision) instead

If you have a fraction "1/2", in decimal it should be "0.5".

Returns None in case we couldn't write the result into a string, e.g. not enough RAM.

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! ("0.5", &F::new (1u8, 2u8).format_as_decimal (1).unwrap ());
assert_eq! ("0.8", &F::new (8u8, 10u8).format_as_decimal (2).unwrap ());
assert_eq! (&F::new (1u8, 3u8).format_as_decimal(32).unwrap(), "0.33333333333333333333333333333333");

pub fn from_decimal_str(src: &str) -> Result<Self, ParseError> where
    T: CheckedAdd + CheckedMul
[src]

Parse a decimal string into a fraction and return the result. Returns ParseError::OverflowError if there's not enough space in T to represent the decimal (use BigFraction in such a case) Returns ParseError::ParseIntError if the string contains incorrect junk data (e.g. non-numeric characters). May return ParseIntError if there is not enough volume in T to read whole part of the number into it.

Examples

use fraction::Fraction;

let f = Fraction::from_decimal_str ("1.5");
assert_eq! (f, Ok (Fraction::new(3u8, 2u8)));

impl<T: Clone + Integer> GenericFraction<T>[src]

pub fn nan() -> Self[src]

Returns NaN value

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::nan (), F::new (0, 0));

pub fn infinity() -> Self[src]

Returns positive Infinity value

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::infinity (), F::new (1, 0));

pub fn neg_infinity() -> Self[src]

Returns negative Infinity value

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::neg_infinity (), F::new_neg (1, 0));

pub fn neg_zero() -> Self[src]

Returns zero with negative sign

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::neg_zero (), F::new_neg (0, 1));

pub fn min_positive_value() -> Self where
    T: Bounded
[src]

Returns minimal value greater than zero

Examples

use fraction::GenericFraction;
type F8 = GenericFraction<u8>;
type F16 = GenericFraction<u16>;

assert_eq! (F8::min_positive_value (), F8::new (1u8, 255u8));
assert_eq! (F16::min_positive_value (), F16::new (1u16, 65535u16));

pub fn is_nan(&self) -> bool[src]

Returns true if the value is NaN

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert! (F::nan ().is_nan ());
assert! (F::new (0, 0).is_nan ());

pub fn is_infinite(&self) -> bool[src]

Returns true if the value is Infinity (does not matter positive or negative)

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert! (F::infinity ().is_infinite ());
assert! (F::new (1u8, 0).is_infinite ());
assert! (F::new_neg (1u8, 0).is_infinite ());

pub fn is_finite(&self) -> bool[src]

Returns true if the value is not Infinity (does not matter positive or negative)

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert! (! F::infinity ().is_finite ());
assert! (! F::new (1u8, 0).is_finite ());
assert! (! F::new_neg (1u8, 0).is_finite ());

pub fn is_normal(&self) -> bool[src]

Returns true if the number is neither zero, Infinity or NaN

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert! (! F::nan ().is_normal ());
assert! (! F::infinity ().is_normal ());
assert! (! F::neg_infinity ().is_normal ());
assert! (! F::new (0, 1u8).is_normal ());
assert! (! F::neg_zero ().is_normal ());

pub fn classify(&self) -> FpCategory[src]

Returns the floating point category of the number

Examples

use std::num::FpCategory;
use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::nan ().classify (), FpCategory::Nan);
assert_eq! (F::infinity ().classify (), FpCategory::Infinite);
assert_eq! (F::new (0, 1u8).classify (), FpCategory::Zero);
assert_eq! (F::new (1u8, 1u8).classify (), FpCategory::Normal);

pub fn floor(&self) -> Self[src]

Returns the largest integer less than or equal to the value

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::new (7u8, 5u8).floor (), F::new (5u8, 5u8));

pub fn ceil(&self) -> Self[src]

Returns the smallest integer greater than or equal to the value

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::new (7u8, 5u8).ceil (), F::new (10u8, 5u8));

pub fn round(&self) -> Self[src]

Returns the nearest integer to the value (.5 goes up)

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::new (7u8, 5u8).round (), F::new (5u8, 5u8));
assert_eq! (F::new (8u8, 5u8).round (), F::new (10u8, 5u8));
assert_eq! (F::new (3u8, 2u8).round (), F::new (4u8, 2u8));
assert_eq! (F::new (1u8, 2u8).round (), F::new (2u8, 2u8));

pub fn trunc(&self) -> Self[src]

Returns the integer part of the value

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::new (7u8, 5u8).trunc (), F::new (5u8, 5u8));
assert_eq! (F::new (8u8, 5u8).trunc (), F::new (5u8, 5u8));

pub fn fract(&self) -> Self[src]

Returns the fractional part of a number

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::new (7u8, 5u8).fract (), F::new (2u8, 5u8));
assert_eq! (F::new (8u8, 5u8).fract (), F::new (3u8, 5u8));

pub fn abs(&self) -> Self[src]

Returns the absolute value of self

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::nan ().abs (), F::nan ());
assert_eq! (F::infinity ().abs (), F::infinity ());
assert_eq! (F::neg_infinity ().abs (), F::infinity ());
assert_eq! (F::new (1u8, 2u8).abs (), F::new (1u8, 2u8));
assert_eq! (F::new_neg (1u8, 2u8).abs (), F::new (1u8, 2u8));

pub fn signum(&self) -> Self[src]

Returns a number that represents the sign of self

  • 1.0 if the number is positive, +0.0 or INFINITY
  • -1.0 if the number is negative, -0.0 or NEG_INFINITY
  • NAN if the number is NAN

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::new (1u8, 2u8).signum (), F::new (1u8, 1u8));
assert_eq! (F::new (0u8, 1u8).signum (), F::new (1u8, 1u8));
assert_eq! (F::infinity ().signum (), F::new (1u8, 1u8));
assert_eq! (F::new_neg (1u8, 2u8).signum (), F::new_neg (1u8, 1u8));
assert_eq! (F::neg_zero ().signum (), F::new_neg (1u8, 1u8));
assert_eq! (F::neg_infinity ().signum (), F::new_neg (1u8, 1u8));
assert_eq! (F::nan ().signum (), F::nan ());

pub fn is_sign_positive(&self) -> bool[src]

Returns true if the sign is positive

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert! (F::new (1u8, 2u8).is_sign_positive ());
assert! (F::infinity ().is_sign_positive ());
assert! (! F::nan ().is_sign_positive ());

pub fn is_sign_negative(&self) -> bool[src]

Returns true if the sign is negative

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert! (F::new_neg (1u8, 2u8).is_sign_negative ());
assert! (F::neg_zero ().is_sign_negative ());
assert! (F::neg_infinity ().is_sign_negative ());
assert! (! F::nan ().is_sign_negative ());

pub fn mul_add(&self, a: Self, b: Self) -> Self[src]

self.clone () * a + b

Added for interface compatibility with float types

pub fn recip(&self) -> Self[src]

Takes the reciprocal (inverse) of the value (1/x)

Examples

use fraction::GenericFraction;
type F = GenericFraction<u8>;

assert_eq! (F::new (1u8, 2u8).recip (), F::new (2u8, 1u8));
assert_eq! (F::new (0u8, 1u8).recip (), F::infinity ());
assert_eq! (F::infinity ().recip (), F::new (0u8, 1u8));
assert_eq! (F::nan ().recip (), F::nan ());

Trait Implementations

impl<'a, T> Add<&'a GenericFraction<T>> for &'a GenericFraction<T> where
    T: Clone + Integer
[src]

type Output = GenericFraction<T>

The resulting type after applying the + operator.

impl<T: Clone + Integer> Add<GenericFraction<T>> for GenericFraction<T>[src]

type Output = Self

The resulting type after applying the + operator.

impl<'a, T> AddAssign<&'a GenericFraction<T>> for GenericFraction<T> where
    T: Clone + Integer
[src]

impl<T: Clone + Integer> AddAssign<GenericFraction<T>> for GenericFraction<T>[src]

impl<T: Bounded + Clone + Integer> Bounded for GenericFraction<T>[src]

impl<T> CheckedAdd for GenericFraction<T> where
    T: Clone + Integer + CheckedAdd + CheckedSub + CheckedMul
[src]

impl<T> CheckedDiv for GenericFraction<T> where
    T: Clone + Integer + CheckedDiv + CheckedMul
[src]

impl<T> CheckedMul for GenericFraction<T> where
    T: Clone + Integer + CheckedMul
[src]

impl<T> CheckedSub for GenericFraction<T> where
    T: Clone + Integer + CheckedAdd + CheckedSub + CheckedMul
[src]

impl<T: Clone> Clone for GenericFraction<T> where
    T: Clone + Integer
[src]

impl<T> Copy for GenericFraction<T> where
    T: Copy + Integer
[src]

Copy semantics to be applied for the target type, but only if T also has it.

impl<T: Debug> Debug for GenericFraction<T> where
    T: Clone + Integer
[src]

impl<'de, T> Deserialize<'de> for GenericFraction<T> where
    T: Clone + Integer,
    T: Deserialize<'de>, 
[src]

impl<T: Clone + GenericInteger> Display for GenericFraction<T>[src]

impl<'a, T> Div<&'a GenericFraction<T>> for &'a GenericFraction<T> where
    T: Clone + Integer
[src]

type Output = GenericFraction<T>

The resulting type after applying the / operator.

impl<T: Clone + Integer> Div<GenericFraction<T>> for GenericFraction<T>[src]

type Output = Self

The resulting type after applying the / operator.

impl<'a, T> DivAssign<&'a GenericFraction<T>> for GenericFraction<T> where
    T: Clone + Integer
[src]

impl<T: Clone + Integer> DivAssign<GenericFraction<T>> for GenericFraction<T>[src]

impl<T: Clone + Integer> Eq for GenericFraction<T>[src]

impl<T, N, D> From<(N, D)> for GenericFraction<T> where
    T: Clone + Integer,
    N: Display,
    D: Display
[src]

impl<T> From<BigInt> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    BigInt: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<BigUint> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    BigUint: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T: Clone + FromPrimitive + Integer + CheckedAdd + CheckedMul + CheckedSub> From<f32> for GenericFraction<T>[src]

impl<T: Clone + FromPrimitive + Integer + CheckedAdd + CheckedMul + CheckedSub> From<f64> for GenericFraction<T>[src]

impl<T> From<i128> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    i128: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<i16> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    i16: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<i32> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    i32: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<i64> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    i64: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<i8> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    i8: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<isize> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    isize: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<u128> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    u128: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<u16> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    u16: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<u32> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    u32: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<u64> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    u64: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<u8> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    u8: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<T> From<usize> for GenericFraction<T> where
    T: Clone + Integer + GenericInteger + CheckedAdd + CheckedMul + CheckedSub,
    usize: GenericInteger + CheckedAdd + CheckedDiv + CheckedMul + CheckedSub + PartialOrd
[src]

impl<S, T> FromInputValue<S> for GenericFraction<T> where
    S: ScalarValue,
    &'a S: ScalarRefValue<'a>,
    T: Clone + Integer + CheckedAdd + CheckedMul + CheckedSub + Num + One
[src]

impl<T> FromSql for GenericFraction<T> where
    T: Clone + GenericInteger + From<u16>, 
[src]

impl<S, T> GraphQLType<S> for GenericFraction<T> where
    S: ScalarValue,
    &'a S: ScalarRefValue<'a>,
    T: Clone + GenericInteger + Display + 'static, 
[src]

type Context = ()

The expected context type for this GraphQL type Read more

type TypeInfo = ()

Type that may carry additional schema information Read more

impl<T: Clone + Integer + Hash> Hash for GenericFraction<T>[src]

impl<'a, T> Mul<&'a GenericFraction<T>> for &'a GenericFraction<T> where
    T: Clone + Integer
[src]

type Output = GenericFraction<T>

The resulting type after applying the * operator.

impl<T: Clone + Integer> Mul<GenericFraction<T>> for GenericFraction<T>[src]

type Output = Self

The resulting type after applying the * operator.

impl<'a, T> MulAssign<&'a GenericFraction<T>> for GenericFraction<T> where
    T: Clone + Integer
[src]

impl<T: Clone + Integer> MulAssign<GenericFraction<T>> for GenericFraction<T>[src]

impl<T: Clone + Integer> Neg for GenericFraction<T>[src]

type Output = GenericFraction<T>

The resulting type after applying the - operator.

impl<'a, T: Clone + Integer> Neg for &'a GenericFraction<T>[src]

type Output = GenericFraction<T>

The resulting type after applying the - operator.

impl<T: Clone + Integer> Num for GenericFraction<T>[src]

type FromStrRadixErr = ParseRatioError

impl<T: Clone + Integer> One for GenericFraction<T>[src]

impl<S, T> ParseScalarValue<S> for GenericFraction<T> where
    S: ScalarValue,
    &'a S: ScalarRefValue<'a>,
    T: Clone + Integer + CheckedAdd + CheckedMul + CheckedSub + Display
[src]

impl<T: Clone + Integer> PartialEq<GenericFraction<T>> for GenericFraction<T>[src]

impl<T: Clone + Integer> PartialOrd<GenericFraction<T>> for GenericFraction<T>[src]

impl<'a, T: 'a + Clone + Integer> Product<&'a GenericFraction<T>> for GenericFraction<T>[src]

impl<T: Clone + Integer> Product<GenericFraction<T>> for GenericFraction<T>[src]

impl<'a, T> Rem<&'a GenericFraction<T>> for &'a GenericFraction<T> where
    T: Clone + Integer
[src]

type Output = GenericFraction<T>

The resulting type after applying the % operator.

impl<T: Clone + Integer> Rem<GenericFraction<T>> for GenericFraction<T>[src]

type Output = Self

The resulting type after applying the % operator.

impl<'a, T> RemAssign<&'a GenericFraction<T>> for GenericFraction<T> where
    T: Clone + Integer
[src]

impl<T: Clone + Integer> RemAssign<GenericFraction<T>> for GenericFraction<T>[src]

impl<T> Serialize for GenericFraction<T> where
    T: Clone + Integer,
    T: Serialize
[src]

impl<T: Clone + Integer> Signed for GenericFraction<T>[src]

impl<'a, T> Sub<&'a GenericFraction<T>> for &'a GenericFraction<T> where
    T: Clone + Integer
[src]

type Output = GenericFraction<T>

The resulting type after applying the - operator.

impl<T: Clone + Integer> Sub<GenericFraction<T>> for GenericFraction<T>[src]

type Output = Self

The resulting type after applying the - operator.

impl<'a, T> SubAssign<&'a GenericFraction<T>> for GenericFraction<T> where
    T: Clone + Integer
[src]

impl<T: Clone + Integer> SubAssign<GenericFraction<T>> for GenericFraction<T>[src]

impl<'a, T: 'a + Clone + Integer> Sum<&'a GenericFraction<T>> for GenericFraction<T>[src]

impl<T: Clone + Integer> Sum<GenericFraction<T>> for GenericFraction<T>[src]

impl<S, T> ToInputValue<S> for GenericFraction<T> where
    S: ScalarValue,
    &'a S: ScalarRefValue<'a>,
    T: Clone + GenericInteger
[src]

impl<T: Clone + Integer + PartialEq + ToPrimitive> ToPrimitive for GenericFraction<T>[src]

impl<T> ToSql for GenericFraction<T> where
    T: Clone + GenericInteger + From<u8> + Debug
[src]

impl<T, F> TryToConvertFrom<GenericFraction<F>> for GenericFraction<T> where
    T: TryToConvertFrom<F> + Clone + Integer,
    F: Clone + Integer
[src]

impl<T: Clone + Integer> Zero for GenericFraction<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for GenericFraction<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for GenericFraction<T> where
    T: Send
[src]

impl<T> Sync for GenericFraction<T> where
    T: Sync
[src]

impl<T> Unpin for GenericFraction<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for GenericFraction<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> NumAssign for T where
    T: Num + NumAssignOps<T>, 
[src]

impl<T, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]

impl<T> NumAssignRef for T where
    T: NumAssign + for<'r> NumAssignOps<&'r T>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.