# Struct num_rational::Ratio
[−]
[src]

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

Represents the ratio between 2 numbers.

## Methods

`impl<T: Clone + Integer> Ratio<T>`

[src]

`fn new(numer: T, denom: T) -> Ratio<T>`

Creates a new `Ratio`

. Fails if `denom`

is zero.

`fn from_integer(t: T) -> Ratio<T>`

Creates a `Ratio`

representing the integer `t`

.

`fn new_raw(numer: T, denom: T) -> Ratio<T>`

Creates a `Ratio`

without checking for `denom == 0`

or reducing.

`fn to_integer(&self) -> T`

Converts to an integer, rounding towards zero.

`fn numer<'a>(&'a self) -> &'a T`

Gets an immutable reference to the numerator.

`fn denom<'a>(&'a self) -> &'a T`

Gets an immutable reference to the denominator.

`fn is_integer(&self) -> bool`

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

`fn reduced(&self) -> Ratio<T>`

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`

.

`fn recip(&self) -> Ratio<T>`

Returns the reciprocal.

Fails if the `Ratio`

is zero.

`fn floor(&self) -> Ratio<T>`

Rounds towards minus infinity.

`fn ceil(&self) -> Ratio<T>`

Rounds towards plus infinity.

`fn round(&self) -> Ratio<T>`

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

`fn trunc(&self) -> Ratio<T>`

Rounds towards zero.

`fn fract(&self) -> Ratio<T>`

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

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

.

`impl<T: Clone + Integer + PrimInt> Ratio<T>`

[src]

`impl Ratio<BigInt>`

[src]

`fn from_float<T: Float>(f: T) -> Option<BigRational>`

Converts a float into a rational number.

`impl<T: Integer + Signed + Bounded + NumCast + Clone> Ratio<T>`

[src]

`fn approximate_float<F: Float + NumCast>(f: F) -> Option<Ratio<T>>`

## Trait Implementations

`impl<T: Copy> Copy for Ratio<T>`

[src]

`impl<T: Clone> Clone for Ratio<T>`

[src]

`fn clone(&self) -> Ratio<T>`

Returns a copy of the value. Read more

`fn clone_from(&mut self, source: &Self)`

1.0.0

Performs copy-assignment from `source`

. Read more

`impl<T: Hash> Hash for Ratio<T>`

[src]

`fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)`

Feeds this value into the given [`Hasher`

]. Read more

`fn hash_slice<H>(data: &[Self], state: &mut H) where`

H: Hasher,

1.3.0

H: Hasher,

Feeds a slice of this type into the given [`Hasher`

]. Read more

`impl<T: Debug> Debug for Ratio<T>`

[src]

`impl<T: Encodable> Encodable for Ratio<T>`

[src]

`fn encode<__ST: Encoder>(&self, __arg_0: &mut __ST) -> Result<(), __ST::Error>`

Serialize a value using an `Encoder`

.

`impl<T: Decodable> Decodable for Ratio<T>`

[src]

`fn decode<__DT: Decoder>(__arg_0: &mut __DT) -> Result<Ratio<T>, __DT::Error>`

Deserialize a value using a `Decoder`

.

`impl<T> From<T> for Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`impl<T> From<(T, T)> for Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`impl<T: Clone + Integer> Ord for Ratio<T>`

[src]

`fn cmp(&self, other: &Self) -> Ordering`

This method returns an `Ordering`

between `self`

and `other`

. Read more

`impl<T: Clone + Integer> PartialOrd for Ratio<T>`

[src]

`fn partial_cmp(&self, other: &Self) -> Option<Ordering>`

This method returns an ordering between `self`

and `other`

values if one exists. Read more

`fn lt(&self, other: &Rhs) -> bool`

1.0.0

This method tests less than (for `self`

and `other`

) and is used by the `<`

operator. Read more

`fn le(&self, other: &Rhs) -> bool`

1.0.0

This method tests less than or equal to (for `self`

and `other`

) and is used by the `<=`

operator. Read more

`fn gt(&self, other: &Rhs) -> bool`

1.0.0

This method tests greater than (for `self`

and `other`

) and is used by the `>`

operator. Read more

`fn ge(&self, other: &Rhs) -> bool`

1.0.0

This method tests greater than or equal to (for `self`

and `other`

) and is used by the `>=`

operator. Read more

`impl<T: Clone + Integer> PartialEq for Ratio<T>`

[src]

`fn eq(&self, other: &Self) -> bool`

This method tests for `self`

and `other`

values to be equal, and is used by `==`

. Read more

`fn ne(&self, other: &Rhs) -> bool`

1.0.0

This method tests for `!=`

.

`impl<T: Clone + Integer> Eq for Ratio<T>`

[src]

`impl<T: Clone + Integer> Mul<Ratio<T>> for Ratio<T>`

[src]

`type Output = Ratio<T>`

The resulting type after applying the `*`

operator

`fn mul(self, other: Ratio<T>) -> Ratio<T>`

The method for the `*`

operator

`impl<'a, T> Mul<Ratio<T>> for &'a Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `*`

operator

`fn mul(self, other: Ratio<T>) -> Ratio<T>`

The method for the `*`

operator

`impl<'a, T> Mul<&'a Ratio<T>> for Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `*`

operator

`fn mul(self, other: &Ratio<T>) -> Ratio<T>`

The method for the `*`

operator

`impl<'a, 'b, T> Mul<&'b Ratio<T>> for &'a Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `*`

operator

`fn mul(self, rhs: &Ratio<T>) -> Ratio<T>`

The method for the `*`

operator

`impl<T: Clone + Integer> Div<Ratio<T>> for Ratio<T>`

[src]

`type Output = Ratio<T>`

The resulting type after applying the `/`

operator

`fn div(self, other: Ratio<T>) -> Ratio<T>`

The method for the `/`

operator

`impl<'a, T> Div<Ratio<T>> for &'a Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `/`

operator

`fn div(self, other: Ratio<T>) -> Ratio<T>`

The method for the `/`

operator

`impl<'a, T> Div<&'a Ratio<T>> for Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `/`

operator

`fn div(self, other: &Ratio<T>) -> Ratio<T>`

The method for the `/`

operator

`impl<'a, 'b, T> Div<&'b Ratio<T>> for &'a Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `/`

operator

`fn div(self, rhs: &Ratio<T>) -> Ratio<T>`

The method for the `/`

operator

`impl<T: Clone + Integer> Add<Ratio<T>> for Ratio<T>`

[src]

`type Output = Ratio<T>`

The resulting type after applying the `+`

operator

`fn add(self, other: Ratio<T>) -> Ratio<T>`

The method for the `+`

operator

`impl<'a, T> Add<Ratio<T>> for &'a Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `+`

operator

`fn add(self, other: Ratio<T>) -> Ratio<T>`

The method for the `+`

operator

`impl<'a, T> Add<&'a Ratio<T>> for Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `+`

operator

`fn add(self, other: &Ratio<T>) -> Ratio<T>`

The method for the `+`

operator

`impl<'a, 'b, T: Clone + Integer> Add<&'b Ratio<T>> for &'a Ratio<T>`

[src]

`type Output = Ratio<T>`

The resulting type after applying the `+`

operator

`fn add(self, rhs: &Ratio<T>) -> Ratio<T>`

The method for the `+`

operator

`impl<T: Clone + Integer> Sub<Ratio<T>> for Ratio<T>`

[src]

`type Output = Ratio<T>`

The resulting type after applying the `-`

operator

`fn sub(self, other: Ratio<T>) -> Ratio<T>`

The method for the `-`

operator

`impl<'a, T> Sub<Ratio<T>> for &'a Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `-`

operator

`fn sub(self, other: Ratio<T>) -> Ratio<T>`

The method for the `-`

operator

`impl<'a, T> Sub<&'a Ratio<T>> for Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `-`

operator

`fn sub(self, other: &Ratio<T>) -> Ratio<T>`

The method for the `-`

operator

`impl<'a, 'b, T: Clone + Integer> Sub<&'b Ratio<T>> for &'a Ratio<T>`

[src]

`type Output = Ratio<T>`

The resulting type after applying the `-`

operator

`fn sub(self, rhs: &Ratio<T>) -> Ratio<T>`

The method for the `-`

operator

`impl<T: Clone + Integer> Rem<Ratio<T>> for Ratio<T>`

[src]

`type Output = Ratio<T>`

The resulting type after applying the `%`

operator

`fn rem(self, other: Ratio<T>) -> Ratio<T>`

The method for the `%`

operator

`impl<'a, T> Rem<Ratio<T>> for &'a Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `%`

operator

`fn rem(self, other: Ratio<T>) -> Ratio<T>`

The method for the `%`

operator

`impl<'a, T> Rem<&'a Ratio<T>> for Ratio<T> where`

T: Clone + Integer,

[src]

T: Clone + Integer,

`type Output = Ratio<T>`

The resulting type after applying the `%`

operator

`fn rem(self, other: &Ratio<T>) -> Ratio<T>`

The method for the `%`

operator

`impl<'a, 'b, T: Clone + Integer> Rem<&'b Ratio<T>> for &'a Ratio<T>`

[src]

`type Output = Ratio<T>`

The resulting type after applying the `%`

operator

`fn rem(self, rhs: &Ratio<T>) -> Ratio<T>`

The method for the `%`

operator

`impl<T> Neg for Ratio<T> where`

T: Clone + Integer + Neg<Output = T>,

[src]

T: Clone + Integer + Neg<Output = T>,

`type Output = Ratio<T>`

The resulting type after applying the `-`

operator

`fn neg(self) -> Ratio<T>`

The method for the unary `-`

operator

`impl<'a, T> Neg for &'a Ratio<T> where`

T: Clone + Integer + Neg<Output = T>,

[src]

T: Clone + Integer + Neg<Output = T>,

`type Output = Ratio<T>`

The resulting type after applying the `-`

operator

`fn neg(self) -> Ratio<T>`

The method for the unary `-`

operator

`impl<T: Clone + Integer> Zero for Ratio<T>`

[src]

`fn zero() -> Ratio<T>`

Returns the additive identity element of `Self`

, `0`

. Read more

`fn is_zero(&self) -> bool`

Returns `true`

if `self`

is equal to the additive identity.

`impl<T: Clone + Integer> One for Ratio<T>`

[src]

`impl<T: Clone + Integer> Num for Ratio<T>`

[src]

`type FromStrRadixErr = ParseRatioError`

`fn from_str_radix(s: &str, radix: u32) -> Result<Ratio<T>, ParseRatioError>`

Parses `numer/denom`

where the numbers are in base `radix`

.

`impl<T: Clone + Integer + Signed> Signed for Ratio<T>`

[src]

`fn abs(&self) -> Ratio<T>`

Computes the absolute value. Read more

`fn abs_sub(&self, other: &Ratio<T>) -> Ratio<T>`

The positive difference of two numbers. Read more

`fn signum(&self) -> Ratio<T>`

Returns the sign of the number. Read more

`fn is_positive(&self) -> bool`

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

`fn is_negative(&self) -> bool`

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

`impl<T> Display for Ratio<T> where`

T: Display + Eq + One,

[src]

T: Display + Eq + One,

`impl<T: FromStr + Clone + Integer> FromStr for Ratio<T>`

[src]

`type Err = ParseRatioError`

The associated error which can be returned from parsing.

`fn from_str(s: &str) -> Result<Ratio<T>, ParseRatioError>`

Parses `numer/denom`

or just `numer`

.

`impl<T> Into<(T, T)> for Ratio<T>`

[src]

`impl FromPrimitive for Ratio<BigInt>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

Convert an `i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

Convert an `u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

Convert a `f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

Convert a `f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

Convert an `isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

Convert an `i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

Convert an `i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

Convert an `i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

Convert a `usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

Convert an `u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

Convert an `u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

Convert an `u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<i8>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

Convert an `i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

Convert an `u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

Convert a `f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

Convert a `f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

Convert an `isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

Convert an `i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

Convert an `i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

Convert an `i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

Convert a `usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

Convert an `u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

Convert an `u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

Convert an `u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<i16>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

Convert an `i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

Convert an `u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

Convert a `f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

Convert a `f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

Convert an `isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

Convert an `i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

Convert an `i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

Convert an `i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

Convert a `usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

Convert an `u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

Convert an `u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

Convert an `u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<i32>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

`i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

`u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

`f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

`f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

`isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

`i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

`i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

`i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

`usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

`u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

`u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

`u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<i64>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

`i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

`u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

`f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

`f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

`isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

`i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

`i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

`i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

`usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

`u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

`u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

`u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<isize>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

`i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

`u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

`f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

`f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

`isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

`i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

`i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

`i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

`usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

`u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

`u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

`u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<u8>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

`i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

`u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

`f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

`f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

`isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

`i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

`i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

`i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

`usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

`u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

`u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

`u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<u16>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

`i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

`u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

`f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

`f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

`isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

`i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

`i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

`i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

`usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

`u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

`u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

`u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<u32>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

`i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

`u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

`f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

`f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

`isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

`i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

`i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

`i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

`usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

`u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

`u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

`u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<u64>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

`i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

`u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

`f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

`f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

`isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

`i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

`i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

`i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

`usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

`u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

`u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

`u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`impl FromPrimitive for Ratio<usize>`

[src]

`fn from_i64(n: i64) -> Option<Self>`

`i64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u64(n: u64) -> Option<Self>`

`u64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f32(n: f32) -> Option<Self>`

`f32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_f64(n: f64) -> Option<Self>`

`f64`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_isize(n: isize) -> Option<Self>`

`isize`

to return an optional value of this type. If the value cannot be represented by this value, the `None`

is returned. Read more

`fn from_i8(n: i8) -> Option<Self>`

`i8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i16(n: i16) -> Option<Self>`

`i16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_i32(n: i32) -> Option<Self>`

`i32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_usize(n: usize) -> Option<Self>`

`usize`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u8(n: u8) -> Option<Self>`

`u8`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u16(n: u16) -> Option<Self>`

`u16`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more

`fn from_u32(n: u32) -> Option<Self>`

`u32`

to return an optional value of this type. If the type cannot be represented by this value, the `None`

is returned. Read more