referrerpolicy=no-referrer-when-downgrade
polkadot_service::runtime_traits

Trait Scale

Source
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§

Source

type Output

The output type of the product of self and Other.

Required Methods§

Source

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

@return the product of self and other.

Source

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

@return the integer division of self and other.

Source

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

@return the modulo remainder of self and other.

Implementations on Foreign Types§

Source§

impl Scale<u8> for u8

Source§

type Output = u8

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u8> for u16

Source§

type Output = u16

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u8> for u32

Source§

type Output = u32

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u8> for u64

Source§

type Output = u64

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u8> for u128

Source§

type Output = u128

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u16> for u16

Source§

type Output = u16

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u16> for u32

Source§

type Output = u32

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u16> for u64

Source§

type Output = u64

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u16> for u128

Source§

type Output = u128

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u32> for u32

Source§

type Output = u32

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u32> for u64

Source§

type Output = u64

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u32> for u128

Source§

type Output = u128

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u64> for u64

Source§

type Output = u64

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u64> for u128

Source§

type Output = u128

Source§

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

Source§

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

Source§

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

Source§

impl Scale<u128> for u128

Source§

type Output = u128

Source§

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

Source§

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

Source§

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

Implementors§