[][src]Struct fraction::Ratio

pub struct Ratio<T> { /* fields omitted */ }

Represents the ratio between two numbers.

Methods

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

Creates a new Ratio. Fails if denom is zero.

Creates a Ratio representing the integer t.

Creates a Ratio without checking for denom == 0 or reducing.

Converts to an integer, rounding towards zero.

Gets an immutable reference to the numerator.

Gets an immutable reference to the denominator.

Returns true if the rational number is an integer (denominator is 1).

Returns a reduced copy of self.

In general, it is not necessary to use this method, as the only method of procuring a non-reduced fraction is through new_raw.

Returns the reciprocal.

Fails if the Ratio is zero.

Rounds towards minus infinity.

Rounds towards plus infinity.

Rounds to the nearest integer. Rounds half-way cases away from zero.

Rounds towards zero.

Returns the fractional part of a number, with division rounded towards zero.

Satisfies self == self.trunc() + self.fract().

impl<T> Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

Raises the Ratio to the power of an exponent.

impl Ratio<BigInt>
[src]

Converts a float into a rational number.

impl<T> Ratio<T> where
    T: Clone + Integer + Bounded + NumCast + Signed
[src]

Trait Implementations

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

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

Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more

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

Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more

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

Returns the multiplicative identity element of Self, 1. Read more

Returns true if self is equal to the multiplicative identity. Read more

impl<T> Into<(T, T)> for Ratio<T>
[src]

Performs the conversion.

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

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

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

The resulting type after applying the + operator.

Performs the + operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

The resulting type after applying the + operator.

Performs the + operation.

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

Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned. Read more

impl<T> Display for Ratio<T> where
    T: Display + Eq + One
[src]

Renders as numer/denom. If denom=1, renders as numer.

impl<T> Copy for Ratio<T> where
    T: Copy
[src]

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

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

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

Deserialize this value from the given Serde deserializer. Read more

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

Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned. Read more

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

Serialize this value into the given Serde serializer. Read more

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

Performs the *= operation.

impl<T> MulAssign<Ratio<T>> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the *= operation.

impl<T> MulAssign<T> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the *= operation.

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

Performs the *= operation.

impl<T> AddAssign<Ratio<T>> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the += operation.

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

Performs the += operation.

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

Performs the += operation.

impl<T> AddAssign<T> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the += operation.

impl FromPrimitive for Ratio<i64>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<i8>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<u16>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<i128>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<u8>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<u32>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<u64>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<isize>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<i32>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<i16>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<usize>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<BigInt>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

impl FromPrimitive for Ratio<u128>
[src]

Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more

Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

The resulting type after applying the % operator.

Performs the % operation.

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

The resulting type after applying the % operator.

Performs the % operation.

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

The resulting type after applying the % operator.

Performs the % operation.

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

The resulting type after applying the % operator.

Performs the % operation.

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

The resulting type after applying the % operator.

Performs the % operation.

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

The resulting type after applying the % operator.

Performs the % operation.

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

The resulting type after applying the % operator.

Performs the % operation.

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

The resulting type after applying the % operator.

Performs the % operation.

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

The associated error which can be returned from parsing.

Parses numer/denom or just numer.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

The resulting type after applying the * operator.

Performs the * operation.

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

Performs the %= operation.

impl<T> RemAssign<Ratio<T>> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the %= operation.

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

Performs the %= operation.

impl<T> RemAssign<T> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the %= operation.

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

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T> From<(T, T)> for Ratio<T> where
    T: Clone + Integer
[src]

Performs the conversion.

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

Performs the conversion.

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

The resulting type after applying the - operator.

Performs the - operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

The resulting type after applying the - operator.

Performs the - operation.

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

Subtracts two numbers, checking for underflow. If underflow happens, None is returned. Read more

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

Computes the absolute value. Read more

The positive difference of two numbers. Read more

Returns the sign of the number. Read more

Returns true if the number is positive and false if the number is zero or negative.

Returns true if the number is negative and false if the number is zero or positive.

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

Adds two numbers, checking for overflow. If overflow happens, None is returned. Read more

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

Method which takes an iterator and generates Self from the elements by multiplying the items. Read more

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

Method which takes an iterator and generates Self from the elements by multiplying the items. Read more

impl<'a, T> Neg for &'a Ratio<T> where
    T: Clone + Integer + Neg<Output = T>, 
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<T> Neg for Ratio<T> where
    T: Clone + Integer + Neg<Output = T>, 
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<'a, 'b, T> Pow<&'a isize> for &'b Ratio<T> where
    T: Clone + Integer + Pow<usize, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<usize> for &'a Ratio<T> where
    T: Clone + Integer + Pow<usize, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<i32> for Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<isize> for &'a Ratio<T> where
    T: Clone + Integer + Pow<usize, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a i32> for &'b Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a i16> for &'b Ratio<T> where
    T: Clone + Integer + Pow<u16, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a i8> for Ratio<T> where
    T: Clone + Integer + Pow<u8, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<usize> for Ratio<T> where
    T: Clone + Integer + Pow<usize, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a u8> for &'b Ratio<T> where
    T: Clone + Integer + Pow<u8, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<u8> for Ratio<T> where
    T: Clone + Integer + Pow<u8, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a u32> for &'b Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a usize> for &'b Ratio<T> where
    T: Clone + Integer + Pow<usize, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<isize> for Ratio<T> where
    T: Clone + Integer + Pow<usize, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<u16> for Ratio<T> where
    T: Clone + Integer + Pow<u16, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a i8> for &'b Ratio<T> where
    T: Clone + Integer + Pow<u8, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a i64> for &'b Ratio<T> where
    T: Clone + Integer + Pow<u64, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<u16> for &'a Ratio<T> where
    T: Clone + Integer + Pow<u16, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<u32> for &'a Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a u16> for Ratio<T> where
    T: Clone + Integer + Pow<u16, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a i32> for Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a u16> for &'b Ratio<T> where
    T: Clone + Integer + Pow<u16, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<i32> for &'a Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<i16> for Ratio<T> where
    T: Clone + Integer + Pow<u16, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a u32> for Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<i64> for &'a Ratio<T> where
    T: Clone + Integer + Pow<u64, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<i8> for &'a Ratio<T> where
    T: Clone + Integer + Pow<u8, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a i64> for Ratio<T> where
    T: Clone + Integer + Pow<u64, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a isize> for Ratio<T> where
    T: Clone + Integer + Pow<usize, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a i16> for Ratio<T> where
    T: Clone + Integer + Pow<u16, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a u8> for Ratio<T> where
    T: Clone + Integer + Pow<u8, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a usize> for Ratio<T> where
    T: Clone + Integer + Pow<usize, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<i8> for Ratio<T> where
    T: Clone + Integer + Pow<u8, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<i16> for &'a Ratio<T> where
    T: Clone + Integer + Pow<u16, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<i64> for Ratio<T> where
    T: Clone + Integer + Pow<u64, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<u64> for Ratio<T> where
    T: Clone + Integer + Pow<u64, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<&'a u64> for Ratio<T> where
    T: Clone + Integer + Pow<u64, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<u8> for &'a Ratio<T> where
    T: Clone + Integer + Pow<u8, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<T> Pow<u32> for Ratio<T> where
    T: Clone + Integer + Pow<u32, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, T> Pow<u64> for &'a Ratio<T> where
    T: Clone + Integer + Pow<u64, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

impl<'a, 'b, T> Pow<&'a u64> for &'b Ratio<T> where
    T: Clone + Integer + Pow<u64, Output = T>, 
[src]

The result after applying the operator.

Returns self to the power rhs. Read more

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

Parses numer/denom where the numbers are in base radix.

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

The result after applying the operator.

Returns the multiplicative inverse of self. Read more

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

The result after applying the operator.

Returns the multiplicative inverse of self. Read more

impl<T> DivAssign<T> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the /= operation.

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

Performs the /= operation.

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

Performs the /= operation.

impl<T> DivAssign<Ratio<T>> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the /= operation.

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

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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

The resulting type after applying the / operator.

Performs the / operation.

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

The resulting type after applying the / operator.

Performs the / operation.

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

The resulting type after applying the / operator.

Performs the / operation.

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

The resulting type after applying the / operator.

Performs the / operation.

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

The resulting type after applying the / operator.

Performs the / operation.

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

The resulting type after applying the / operator.

Performs the / operation.

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

The resulting type after applying the / operator.

Performs the / operation.

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

The resulting type after applying the / operator.

Performs the / operation.

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

Performs the -= operation.

impl<T> SubAssign<Ratio<T>> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the -= operation.

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

Performs the -= operation.

impl<T> SubAssign<T> for Ratio<T> where
    T: Clone + Integer + NumAssign
[src]

Performs the -= operation.

impl<T> Debug for Ratio<T> where
    T: Debug
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> Send for Ratio<T> where
    T: Send

impl<T> Sync for Ratio<T> where
    T: Sync

Blanket Implementations

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

Performs the conversion.

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

Converts the given value to a String. Read more

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

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> NumRef for T where
    T: Num + NumOps<&'r T, T>, 
[src]

impl<T, Rhs, Output> NumOps 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, Base> RefNum for T where
    T: NumOps<Base, Base> + NumOps<&'r Base, Base>, 
[src]

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

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

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

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

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

Compare self to key and return true if they are equal.

impl<T> Same for T

Should always be Self