[][src]Struct decimal_percentage::Percentage

pub struct Percentage(_);

Percentage Type

  • Example:
let p1 = Percentage::from(0.1f64);
let p2 = Percentage::from(0.1f32);
let p3 = Percentage::try_from("0.1").unwrap();

assert_eq!(p1 + p2, Percentage::from(0.2));
assert_eq!(p1 + 0.2, Percentage::from(0.3));

Trait Implementations

impl Add<Decimal> for Percentage[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Percentage> for Percentage[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Percentage> for Decimal[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for u32[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for u64[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for f64[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for f32[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for isize[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for i8[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for i16[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for i32[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for i64[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for usize[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for u8[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<Percentage> for u16[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<f32> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<f64> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<i16> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<i32> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<i64> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<i8> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<isize> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<u16> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<u32> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<u64> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<u8> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Add<usize> for Percentage[src]

type Output = Percentage

The resulting type after applying the + operator.

impl Clone for Percentage[src]

impl Copy for Percentage[src]

impl Debug for Percentage[src]

impl Display for Percentage[src]

impl Eq for Percentage[src]

impl From<Decimal> for Percentage[src]

impl From<f32> for Percentage[src]

impl From<f64> for Percentage[src]

impl<'a, 'b> Mul<&'a Percentage> for &'b Percentage[src]

type Output = Percentage

The resulting type after applying the * operator.

impl Mul<Decimal> for Percentage[src]

type Output = Decimal

The resulting type after applying the * operator.

impl Mul<Percentage> for Percentage[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<Percentage> for Decimal[src]

type Output = Decimal

The resulting type after applying the * operator.

impl Mul<Percentage> for u32[src]

type Output = u32

The resulting type after applying the * operator.

impl Mul<Percentage> for u64[src]

type Output = u64

The resulting type after applying the * operator.

impl Mul<Percentage> for f64[src]

type Output = f64

The resulting type after applying the * operator.

impl Mul<Percentage> for f32[src]

type Output = f32

The resulting type after applying the * operator.

impl Mul<Percentage> for isize[src]

type Output = isize

The resulting type after applying the * operator.

impl Mul<Percentage> for i8[src]

type Output = i8

The resulting type after applying the * operator.

impl Mul<Percentage> for i16[src]

type Output = i16

The resulting type after applying the * operator.

impl Mul<Percentage> for i32[src]

type Output = i32

The resulting type after applying the * operator.

impl Mul<Percentage> for i64[src]

type Output = i64

The resulting type after applying the * operator.

impl Mul<Percentage> for usize[src]

type Output = usize

The resulting type after applying the * operator.

impl Mul<Percentage> for u8[src]

type Output = u8

The resulting type after applying the * operator.

impl Mul<Percentage> for u16[src]

type Output = u16

The resulting type after applying the * operator.

impl Mul<f32> for Percentage[src]

type Output = f32

The resulting type after applying the * operator.

impl Mul<f64> for Percentage[src]

type Output = f64

The resulting type after applying the * operator.

impl Mul<i16> for Percentage[src]

type Output = i16

The resulting type after applying the * operator.

impl Mul<i32> for Percentage[src]

type Output = i32

The resulting type after applying the * operator.

impl Mul<i64> for Percentage[src]

type Output = i64

The resulting type after applying the * operator.

impl Mul<i8> for Percentage[src]

type Output = i8

The resulting type after applying the * operator.

impl Mul<isize> for Percentage[src]

type Output = isize

The resulting type after applying the * operator.

impl Mul<u16> for Percentage[src]

type Output = u16

The resulting type after applying the * operator.

impl Mul<u32> for Percentage[src]

type Output = u32

The resulting type after applying the * operator.

impl Mul<u64> for Percentage[src]

type Output = u64

The resulting type after applying the * operator.

impl Mul<u8> for Percentage[src]

type Output = u8

The resulting type after applying the * operator.

impl Mul<usize> for Percentage[src]

type Output = usize

The resulting type after applying the * operator.

impl PartialEq<Percentage> for Percentage[src]

impl StructuralEq for Percentage[src]

impl StructuralPartialEq for Percentage[src]

impl Sub<Percentage> for Percentage[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Percentage> for isize[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for u64[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for f64[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for f32[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for i8[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for i16[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for i32[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for i64[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for usize[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for u8[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for u16[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<Percentage> for u32[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<f32> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<f64> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<i16> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<i32> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<i64> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<i8> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<isize> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<u16> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<u32> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<u64> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<u8> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl Sub<usize> for Percentage[src]

type Output = Percentage

The resulting type after applying the - operator.

impl<'_> TryFrom<&'_ str> for Percentage[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

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> From<T> for T[src]

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

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.