referrerpolicy=no-referrer-when-downgrade

Trait sp_runtime::traits::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

§

type Output = u8

source§

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

source§

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

source§

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

source§

impl Scale<u8> for u16

§

type Output = u16

source§

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

source§

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

source§

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

source§

impl Scale<u8> for u32

§

type Output = u32

source§

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

source§

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

source§

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

source§

impl Scale<u8> for u64

§

type Output = u64

source§

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

source§

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

source§

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

source§

impl Scale<u8> for u128

§

type Output = u128

source§

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

source§

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

source§

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

source§

impl Scale<u16> for u16

§

type Output = u16

source§

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

source§

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

source§

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

source§

impl Scale<u16> for u32

§

type Output = u32

source§

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

source§

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

source§

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

source§

impl Scale<u16> for u64

§

type Output = u64

source§

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

source§

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

source§

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

source§

impl Scale<u16> for u128

§

type Output = u128

source§

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

source§

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

source§

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

source§

impl Scale<u32> for u32

§

type Output = u32

source§

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

source§

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

source§

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

source§

impl Scale<u32> for u64

§

type Output = u64

source§

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

source§

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

source§

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

source§

impl Scale<u32> for u128

§

type Output = u128

source§

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

source§

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

source§

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

source§

impl Scale<u64> for u64

§

type Output = u64

source§

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

source§

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

source§

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

source§

impl Scale<u64> for u128

§

type Output = u128

source§

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

source§

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

source§

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

source§

impl Scale<u128> for u128

§

type Output = u128

source§

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

source§

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

source§

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

Implementors§