pub trait Scale<Other> {
    type Output;

    // Required methods
    fn mul(self, other: Other) -> Self::Output;
    fn div(self, other: Other) -> Self::Output;
    fn rem(self, other: Other) -> Self::Output;
}
Expand description

Multiply and divide by a number that isn’t necessarily the same type. Basically just the same as Mul and Div except it can be used for all basic numeric types.

Required Associated Types§

type Output

The output type of the product of self and Other.

Required Methods§

fn mul(self, other: Other) -> Self::Output

@return the product of self and other.

fn div(self, other: Other) -> Self::Output

@return the integer division of self and other.

fn rem(self, other: Other) -> Self::Output

@return the modulo remainder of self and other.

Implementations on Foreign Types§

§

impl Scale<u8> for u8

§

type Output = u8

§

fn mul(self, other: u8) -> <u8 as Scale<u8>>::Output

§

fn div(self, other: u8) -> <u8 as Scale<u8>>::Output

§

fn rem(self, other: u8) -> <u8 as Scale<u8>>::Output

§

impl Scale<u8> for u16

§

type Output = u16

§

fn mul(self, other: u8) -> <u16 as Scale<u8>>::Output

§

fn div(self, other: u8) -> <u16 as Scale<u8>>::Output

§

fn rem(self, other: u8) -> <u16 as Scale<u8>>::Output

§

impl Scale<u8> for u32

§

type Output = u32

§

fn mul(self, other: u8) -> <u32 as Scale<u8>>::Output

§

fn div(self, other: u8) -> <u32 as Scale<u8>>::Output

§

fn rem(self, other: u8) -> <u32 as Scale<u8>>::Output

§

impl Scale<u8> for u64

§

type Output = u64

§

fn mul(self, other: u8) -> <u64 as Scale<u8>>::Output

§

fn div(self, other: u8) -> <u64 as Scale<u8>>::Output

§

fn rem(self, other: u8) -> <u64 as Scale<u8>>::Output

§

impl Scale<u8> for u128

§

type Output = u128

§

fn mul(self, other: u8) -> <u128 as Scale<u8>>::Output

§

fn div(self, other: u8) -> <u128 as Scale<u8>>::Output

§

fn rem(self, other: u8) -> <u128 as Scale<u8>>::Output

§

impl Scale<u16> for u16

§

type Output = u16

§

fn mul(self, other: u16) -> <u16 as Scale<u16>>::Output

§

fn div(self, other: u16) -> <u16 as Scale<u16>>::Output

§

fn rem(self, other: u16) -> <u16 as Scale<u16>>::Output

§

impl Scale<u16> for u32

§

type Output = u32

§

fn mul(self, other: u16) -> <u32 as Scale<u16>>::Output

§

fn div(self, other: u16) -> <u32 as Scale<u16>>::Output

§

fn rem(self, other: u16) -> <u32 as Scale<u16>>::Output

§

impl Scale<u16> for u64

§

type Output = u64

§

fn mul(self, other: u16) -> <u64 as Scale<u16>>::Output

§

fn div(self, other: u16) -> <u64 as Scale<u16>>::Output

§

fn rem(self, other: u16) -> <u64 as Scale<u16>>::Output

§

impl Scale<u16> for u128

§

type Output = u128

§

fn mul(self, other: u16) -> <u128 as Scale<u16>>::Output

§

fn div(self, other: u16) -> <u128 as Scale<u16>>::Output

§

fn rem(self, other: u16) -> <u128 as Scale<u16>>::Output

§

impl Scale<u32> for u32

§

type Output = u32

§

fn mul(self, other: u32) -> <u32 as Scale<u32>>::Output

§

fn div(self, other: u32) -> <u32 as Scale<u32>>::Output

§

fn rem(self, other: u32) -> <u32 as Scale<u32>>::Output

§

impl Scale<u32> for u64

§

type Output = u64

§

fn mul(self, other: u32) -> <u64 as Scale<u32>>::Output

§

fn div(self, other: u32) -> <u64 as Scale<u32>>::Output

§

fn rem(self, other: u32) -> <u64 as Scale<u32>>::Output

§

impl Scale<u32> for u128

§

type Output = u128

§

fn mul(self, other: u32) -> <u128 as Scale<u32>>::Output

§

fn div(self, other: u32) -> <u128 as Scale<u32>>::Output

§

fn rem(self, other: u32) -> <u128 as Scale<u32>>::Output

§

impl Scale<u64> for u64

§

type Output = u64

§

fn mul(self, other: u64) -> <u64 as Scale<u64>>::Output

§

fn div(self, other: u64) -> <u64 as Scale<u64>>::Output

§

fn rem(self, other: u64) -> <u64 as Scale<u64>>::Output

§

impl Scale<u64> for u128

§

type Output = u128

§

fn mul(self, other: u64) -> <u128 as Scale<u64>>::Output

§

fn div(self, other: u64) -> <u128 as Scale<u64>>::Output

§

fn rem(self, other: u64) -> <u128 as Scale<u64>>::Output

§

impl Scale<u128> for u128

§

type Output = u128

§

fn mul(self, other: u128) -> <u128 as Scale<u128>>::Output

§

fn div(self, other: u128) -> <u128 as Scale<u128>>::Output

§

fn rem(self, other: u128) -> <u128 as Scale<u128>>::Output

Implementors§