pub struct Decimal(pub I192);
Expand description
Decimal
represents a 192 bit representation of a fixed-scale decimal number.
The finite set of values are of the form m / 10^18
, where m
is
an integer such that -2^(192 - 1) <= m < 2^(192 - 1)
.
Fractional part: ~60 bits/18 digits Integer part : 132 bits /40 digits Max : 3138550867693340381917894711603833208051.177722232017256447 Min : -3138550867693340381917894711603833208051.177722232017256448
Unless otherwise specified, all operations will panic if underflow/overflow.
Tuple Fields§
§0: I192
Implementations§
source§impl Decimal
impl Decimal
pub const ZERO: Decimal = Self(I192::ZERO)
pub const ONE_HUNDREDTH: Decimal = Self(I192::from_digits([10u64.pow(Decimal::SCALE - 2), 0, 0]))
pub const ONE_TENTH: Decimal = Self(I192::from_digits([10u64.pow(Decimal::SCALE - 1), 0, 0]))
pub const ONE: Decimal = Self(I192::from_digits([10u64.pow(Decimal::SCALE), 0, 0]))
pub const TEN: Decimal = Self(I192::from_digits([10u64.pow(Decimal::SCALE + 1), 0, 0]))
pub const ONE_HUNDRED: Decimal = Self(I192::from_digits([7766279631452241920, 5, 0]))
sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Whether this decimal is positive.
sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Whether this decimal is negative.
sourcepub fn checked_abs(&self) -> Option<Decimal>
pub fn checked_abs(&self) -> Option<Decimal>
Returns the absolute value.
sourcepub fn checked_floor(&self) -> Option<Decimal>
pub fn checked_floor(&self) -> Option<Decimal>
Returns the largest integer that is equal to or less than this number.
sourcepub fn checked_ceiling(&self) -> Option<Decimal>
pub fn checked_ceiling(&self) -> Option<Decimal>
Returns the smallest integer that is equal to or greater than this number.
sourcepub fn checked_round<T>(
&self,
decimal_places: T,
mode: RoundingMode
) -> Option<Decimal>where
T: Into<i32>,
pub fn checked_round<T>( &self, decimal_places: T, mode: RoundingMode ) -> Option<Decimal>where T: Into<i32>,
Rounds this number to the specified decimal places.
Panics
- Panic if the number of decimal places is not within [0..SCALE]
sourcepub fn checked_powi(&self, exp: i64) -> Option<Decimal>
pub fn checked_powi(&self, exp: i64) -> Option<Decimal>
Calculates power using exponentiation by squaring“.
sourcepub fn checked_sqrt(&self) -> Option<Decimal>
pub fn checked_sqrt(&self) -> Option<Decimal>
Square root of a Decimal
sourcepub fn checked_cbrt(&self) -> Option<Decimal>
pub fn checked_cbrt(&self) -> Option<Decimal>
Cubic root of a Decimal
sourcepub fn checked_nth_root(&self, n: u32) -> Option<Decimal>
pub fn checked_nth_root(&self, n: u32) -> Option<Decimal>
Nth root of a Decimal
Trait Implementations§
source§impl Add<Decimal> for PreciseDecimal
impl Add<Decimal> for PreciseDecimal
source§impl Add<PreciseDecimal> for Decimal
impl Add<PreciseDecimal> for Decimal
§type Output = PreciseDecimal
type Output = PreciseDecimal
+
operator.source§fn add(self, other: PreciseDecimal) -> <Decimal as Add<PreciseDecimal>>::Output
fn add(self, other: PreciseDecimal) -> <Decimal as Add<PreciseDecimal>>::Output
+
operation. Read moresource§impl AddAssign<Decimal> for Decimal
impl AddAssign<Decimal> for Decimal
source§fn add_assign(&mut self, other: Decimal)
fn add_assign(&mut self, other: Decimal)
+=
operation. Read moresource§impl AddAssign<Decimal> for PreciseDecimal
impl AddAssign<Decimal> for PreciseDecimal
source§fn add_assign(&mut self, other: Decimal)
fn add_assign(&mut self, other: Decimal)
+=
operation. Read moresource§impl AddAssign<I192> for Decimal
impl AddAssign<I192> for Decimal
source§fn add_assign(&mut self, other: I192)
fn add_assign(&mut self, other: I192)
+=
operation. Read moresource§impl AddAssign<I256> for Decimal
impl AddAssign<I256> for Decimal
source§fn add_assign(&mut self, other: I256)
fn add_assign(&mut self, other: I256)
+=
operation. Read moresource§impl AddAssign<I320> for Decimal
impl AddAssign<I320> for Decimal
source§fn add_assign(&mut self, other: I320)
fn add_assign(&mut self, other: I320)
+=
operation. Read moresource§impl AddAssign<I448> for Decimal
impl AddAssign<I448> for Decimal
source§fn add_assign(&mut self, other: I448)
fn add_assign(&mut self, other: I448)
+=
operation. Read moresource§impl AddAssign<I512> for Decimal
impl AddAssign<I512> for Decimal
source§fn add_assign(&mut self, other: I512)
fn add_assign(&mut self, other: I512)
+=
operation. Read moresource§impl AddAssign<U192> for Decimal
impl AddAssign<U192> for Decimal
source§fn add_assign(&mut self, other: U192)
fn add_assign(&mut self, other: U192)
+=
operation. Read moresource§impl AddAssign<U256> for Decimal
impl AddAssign<U256> for Decimal
source§fn add_assign(&mut self, other: U256)
fn add_assign(&mut self, other: U256)
+=
operation. Read moresource§impl AddAssign<U320> for Decimal
impl AddAssign<U320> for Decimal
source§fn add_assign(&mut self, other: U320)
fn add_assign(&mut self, other: U320)
+=
operation. Read moresource§impl AddAssign<U448> for Decimal
impl AddAssign<U448> for Decimal
source§fn add_assign(&mut self, other: U448)
fn add_assign(&mut self, other: U448)
+=
operation. Read moresource§impl AddAssign<U512> for Decimal
impl AddAssign<U512> for Decimal
source§fn add_assign(&mut self, other: U512)
fn add_assign(&mut self, other: U512)
+=
operation. Read moresource§impl AddAssign<i128> for Decimal
impl AddAssign<i128> for Decimal
source§fn add_assign(&mut self, other: i128)
fn add_assign(&mut self, other: i128)
+=
operation. Read moresource§impl AddAssign<i16> for Decimal
impl AddAssign<i16> for Decimal
source§fn add_assign(&mut self, other: i16)
fn add_assign(&mut self, other: i16)
+=
operation. Read moresource§impl AddAssign<i32> for Decimal
impl AddAssign<i32> for Decimal
source§fn add_assign(&mut self, other: i32)
fn add_assign(&mut self, other: i32)
+=
operation. Read moresource§impl AddAssign<i64> for Decimal
impl AddAssign<i64> for Decimal
source§fn add_assign(&mut self, other: i64)
fn add_assign(&mut self, other: i64)
+=
operation. Read moresource§impl AddAssign<i8> for Decimal
impl AddAssign<i8> for Decimal
source§fn add_assign(&mut self, other: i8)
fn add_assign(&mut self, other: i8)
+=
operation. Read moresource§impl AddAssign<isize> for Decimal
impl AddAssign<isize> for Decimal
source§fn add_assign(&mut self, other: isize)
fn add_assign(&mut self, other: isize)
+=
operation. Read moresource§impl AddAssign<u128> for Decimal
impl AddAssign<u128> for Decimal
source§fn add_assign(&mut self, other: u128)
fn add_assign(&mut self, other: u128)
+=
operation. Read moresource§impl AddAssign<u16> for Decimal
impl AddAssign<u16> for Decimal
source§fn add_assign(&mut self, other: u16)
fn add_assign(&mut self, other: u16)
+=
operation. Read moresource§impl AddAssign<u32> for Decimal
impl AddAssign<u32> for Decimal
source§fn add_assign(&mut self, other: u32)
fn add_assign(&mut self, other: u32)
+=
operation. Read moresource§impl AddAssign<u64> for Decimal
impl AddAssign<u64> for Decimal
source§fn add_assign(&mut self, other: u64)
fn add_assign(&mut self, other: u64)
+=
operation. Read moresource§impl AddAssign<u8> for Decimal
impl AddAssign<u8> for Decimal
source§fn add_assign(&mut self, other: u8)
fn add_assign(&mut self, other: u8)
+=
operation. Read moresource§impl AddAssign<usize> for Decimal
impl AddAssign<usize> for Decimal
source§fn add_assign(&mut self, other: usize)
fn add_assign(&mut self, other: usize)
+=
operation. Read moresource§impl Categorize<ManifestCustomValueKind> for Decimal
impl Categorize<ManifestCustomValueKind> for Decimal
source§impl Categorize<ScryptoCustomValueKind> for Decimal
impl Categorize<ScryptoCustomValueKind> for Decimal
source§impl CheckedAdd<Decimal> for Decimal
impl CheckedAdd<Decimal> for Decimal
source§impl CheckedAdd<Decimal> for I192
impl CheckedAdd<Decimal> for I192
source§impl CheckedAdd<Decimal> for I256
impl CheckedAdd<Decimal> for I256
source§impl CheckedAdd<Decimal> for I320
impl CheckedAdd<Decimal> for I320
source§impl CheckedAdd<Decimal> for I448
impl CheckedAdd<Decimal> for I448
source§impl CheckedAdd<Decimal> for I512
impl CheckedAdd<Decimal> for I512
source§impl CheckedAdd<Decimal> for PreciseDecimal
impl CheckedAdd<Decimal> for PreciseDecimal
type Output = PreciseDecimal
fn checked_add( self, other: Decimal ) -> Option<<PreciseDecimal as CheckedAdd<Decimal>>::Output>
source§impl CheckedAdd<Decimal> for U192
impl CheckedAdd<Decimal> for U192
source§impl CheckedAdd<Decimal> for U256
impl CheckedAdd<Decimal> for U256
source§impl CheckedAdd<Decimal> for U320
impl CheckedAdd<Decimal> for U320
source§impl CheckedAdd<Decimal> for U448
impl CheckedAdd<Decimal> for U448
source§impl CheckedAdd<Decimal> for U512
impl CheckedAdd<Decimal> for U512
source§impl CheckedAdd<I192> for Decimal
impl CheckedAdd<I192> for Decimal
source§impl CheckedAdd<I256> for Decimal
impl CheckedAdd<I256> for Decimal
source§impl CheckedAdd<I320> for Decimal
impl CheckedAdd<I320> for Decimal
source§impl CheckedAdd<I448> for Decimal
impl CheckedAdd<I448> for Decimal
source§impl CheckedAdd<I512> for Decimal
impl CheckedAdd<I512> for Decimal
source§impl CheckedAdd<PreciseDecimal> for Decimal
impl CheckedAdd<PreciseDecimal> for Decimal
type Output = PreciseDecimal
fn checked_add( self, other: PreciseDecimal ) -> Option<<Decimal as CheckedAdd<PreciseDecimal>>::Output>
source§impl CheckedAdd<U192> for Decimal
impl CheckedAdd<U192> for Decimal
source§impl CheckedAdd<U256> for Decimal
impl CheckedAdd<U256> for Decimal
source§impl CheckedAdd<U320> for Decimal
impl CheckedAdd<U320> for Decimal
source§impl CheckedAdd<U448> for Decimal
impl CheckedAdd<U448> for Decimal
source§impl CheckedAdd<U512> for Decimal
impl CheckedAdd<U512> for Decimal
source§impl CheckedAdd<i128> for Decimal
impl CheckedAdd<i128> for Decimal
source§impl CheckedAdd<i16> for Decimal
impl CheckedAdd<i16> for Decimal
source§impl CheckedAdd<i32> for Decimal
impl CheckedAdd<i32> for Decimal
source§impl CheckedAdd<i64> for Decimal
impl CheckedAdd<i64> for Decimal
source§impl CheckedAdd<i8> for Decimal
impl CheckedAdd<i8> for Decimal
source§impl CheckedAdd<isize> for Decimal
impl CheckedAdd<isize> for Decimal
source§impl CheckedAdd<u128> for Decimal
impl CheckedAdd<u128> for Decimal
source§impl CheckedAdd<u16> for Decimal
impl CheckedAdd<u16> for Decimal
source§impl CheckedAdd<u32> for Decimal
impl CheckedAdd<u32> for Decimal
source§impl CheckedAdd<u64> for Decimal
impl CheckedAdd<u64> for Decimal
source§impl CheckedAdd<u8> for Decimal
impl CheckedAdd<u8> for Decimal
source§impl CheckedAdd<usize> for Decimal
impl CheckedAdd<usize> for Decimal
source§impl CheckedDiv<Decimal> for Decimal
impl CheckedDiv<Decimal> for Decimal
source§impl CheckedDiv<Decimal> for I192
impl CheckedDiv<Decimal> for I192
source§impl CheckedDiv<Decimal> for I256
impl CheckedDiv<Decimal> for I256
source§impl CheckedDiv<Decimal> for I320
impl CheckedDiv<Decimal> for I320
source§impl CheckedDiv<Decimal> for I448
impl CheckedDiv<Decimal> for I448
source§impl CheckedDiv<Decimal> for I512
impl CheckedDiv<Decimal> for I512
source§impl CheckedDiv<Decimal> for PreciseDecimal
impl CheckedDiv<Decimal> for PreciseDecimal
type Output = PreciseDecimal
fn checked_div( self, other: Decimal ) -> Option<<PreciseDecimal as CheckedDiv<Decimal>>::Output>
source§impl CheckedDiv<Decimal> for U192
impl CheckedDiv<Decimal> for U192
source§impl CheckedDiv<Decimal> for U256
impl CheckedDiv<Decimal> for U256
source§impl CheckedDiv<Decimal> for U320
impl CheckedDiv<Decimal> for U320
source§impl CheckedDiv<Decimal> for U448
impl CheckedDiv<Decimal> for U448
source§impl CheckedDiv<Decimal> for U512
impl CheckedDiv<Decimal> for U512
source§impl CheckedDiv<I192> for Decimal
impl CheckedDiv<I192> for Decimal
source§impl CheckedDiv<I256> for Decimal
impl CheckedDiv<I256> for Decimal
source§impl CheckedDiv<I320> for Decimal
impl CheckedDiv<I320> for Decimal
source§impl CheckedDiv<I448> for Decimal
impl CheckedDiv<I448> for Decimal
source§impl CheckedDiv<I512> for Decimal
impl CheckedDiv<I512> for Decimal
source§impl CheckedDiv<PreciseDecimal> for Decimal
impl CheckedDiv<PreciseDecimal> for Decimal
type Output = PreciseDecimal
fn checked_div( self, other: PreciseDecimal ) -> Option<<Decimal as CheckedDiv<PreciseDecimal>>::Output>
source§impl CheckedDiv<U192> for Decimal
impl CheckedDiv<U192> for Decimal
source§impl CheckedDiv<U256> for Decimal
impl CheckedDiv<U256> for Decimal
source§impl CheckedDiv<U320> for Decimal
impl CheckedDiv<U320> for Decimal
source§impl CheckedDiv<U448> for Decimal
impl CheckedDiv<U448> for Decimal
source§impl CheckedDiv<U512> for Decimal
impl CheckedDiv<U512> for Decimal
source§impl CheckedDiv<i128> for Decimal
impl CheckedDiv<i128> for Decimal
source§impl CheckedDiv<i16> for Decimal
impl CheckedDiv<i16> for Decimal
source§impl CheckedDiv<i32> for Decimal
impl CheckedDiv<i32> for Decimal
source§impl CheckedDiv<i64> for Decimal
impl CheckedDiv<i64> for Decimal
source§impl CheckedDiv<i8> for Decimal
impl CheckedDiv<i8> for Decimal
source§impl CheckedDiv<isize> for Decimal
impl CheckedDiv<isize> for Decimal
source§impl CheckedDiv<u128> for Decimal
impl CheckedDiv<u128> for Decimal
source§impl CheckedDiv<u16> for Decimal
impl CheckedDiv<u16> for Decimal
source§impl CheckedDiv<u32> for Decimal
impl CheckedDiv<u32> for Decimal
source§impl CheckedDiv<u64> for Decimal
impl CheckedDiv<u64> for Decimal
source§impl CheckedDiv<u8> for Decimal
impl CheckedDiv<u8> for Decimal
source§impl CheckedDiv<usize> for Decimal
impl CheckedDiv<usize> for Decimal
source§impl CheckedMul<Decimal> for Decimal
impl CheckedMul<Decimal> for Decimal
source§impl CheckedMul<Decimal> for I192
impl CheckedMul<Decimal> for I192
source§impl CheckedMul<Decimal> for I256
impl CheckedMul<Decimal> for I256
source§impl CheckedMul<Decimal> for I320
impl CheckedMul<Decimal> for I320
source§impl CheckedMul<Decimal> for I448
impl CheckedMul<Decimal> for I448
source§impl CheckedMul<Decimal> for I512
impl CheckedMul<Decimal> for I512
source§impl CheckedMul<Decimal> for PreciseDecimal
impl CheckedMul<Decimal> for PreciseDecimal
type Output = PreciseDecimal
fn checked_mul( self, other: Decimal ) -> Option<<PreciseDecimal as CheckedMul<Decimal>>::Output>
source§impl CheckedMul<Decimal> for U192
impl CheckedMul<Decimal> for U192
source§impl CheckedMul<Decimal> for U256
impl CheckedMul<Decimal> for U256
source§impl CheckedMul<Decimal> for U320
impl CheckedMul<Decimal> for U320
source§impl CheckedMul<Decimal> for U448
impl CheckedMul<Decimal> for U448
source§impl CheckedMul<Decimal> for U512
impl CheckedMul<Decimal> for U512
source§impl CheckedMul<I192> for Decimal
impl CheckedMul<I192> for Decimal
source§impl CheckedMul<I256> for Decimal
impl CheckedMul<I256> for Decimal
source§impl CheckedMul<I320> for Decimal
impl CheckedMul<I320> for Decimal
source§impl CheckedMul<I448> for Decimal
impl CheckedMul<I448> for Decimal
source§impl CheckedMul<I512> for Decimal
impl CheckedMul<I512> for Decimal
source§impl CheckedMul<PreciseDecimal> for Decimal
impl CheckedMul<PreciseDecimal> for Decimal
type Output = PreciseDecimal
fn checked_mul( self, other: PreciseDecimal ) -> Option<<Decimal as CheckedMul<PreciseDecimal>>::Output>
source§impl CheckedMul<U192> for Decimal
impl CheckedMul<U192> for Decimal
source§impl CheckedMul<U256> for Decimal
impl CheckedMul<U256> for Decimal
source§impl CheckedMul<U320> for Decimal
impl CheckedMul<U320> for Decimal
source§impl CheckedMul<U448> for Decimal
impl CheckedMul<U448> for Decimal
source§impl CheckedMul<U512> for Decimal
impl CheckedMul<U512> for Decimal
source§impl CheckedMul<i128> for Decimal
impl CheckedMul<i128> for Decimal
source§impl CheckedMul<i16> for Decimal
impl CheckedMul<i16> for Decimal
source§impl CheckedMul<i32> for Decimal
impl CheckedMul<i32> for Decimal
source§impl CheckedMul<i64> for Decimal
impl CheckedMul<i64> for Decimal
source§impl CheckedMul<i8> for Decimal
impl CheckedMul<i8> for Decimal
source§impl CheckedMul<isize> for Decimal
impl CheckedMul<isize> for Decimal
source§impl CheckedMul<u128> for Decimal
impl CheckedMul<u128> for Decimal
source§impl CheckedMul<u16> for Decimal
impl CheckedMul<u16> for Decimal
source§impl CheckedMul<u32> for Decimal
impl CheckedMul<u32> for Decimal
source§impl CheckedMul<u64> for Decimal
impl CheckedMul<u64> for Decimal
source§impl CheckedMul<u8> for Decimal
impl CheckedMul<u8> for Decimal
source§impl CheckedMul<usize> for Decimal
impl CheckedMul<usize> for Decimal
source§impl CheckedNeg<Decimal> for Decimal
impl CheckedNeg<Decimal> for Decimal
source§impl CheckedSub<Decimal> for Decimal
impl CheckedSub<Decimal> for Decimal
source§impl CheckedSub<Decimal> for I192
impl CheckedSub<Decimal> for I192
source§impl CheckedSub<Decimal> for I256
impl CheckedSub<Decimal> for I256
source§impl CheckedSub<Decimal> for I320
impl CheckedSub<Decimal> for I320
source§impl CheckedSub<Decimal> for I448
impl CheckedSub<Decimal> for I448
source§impl CheckedSub<Decimal> for I512
impl CheckedSub<Decimal> for I512
source§impl CheckedSub<Decimal> for PreciseDecimal
impl CheckedSub<Decimal> for PreciseDecimal
type Output = PreciseDecimal
fn checked_sub( self, other: Decimal ) -> Option<<PreciseDecimal as CheckedSub<Decimal>>::Output>
source§impl CheckedSub<Decimal> for U192
impl CheckedSub<Decimal> for U192
source§impl CheckedSub<Decimal> for U256
impl CheckedSub<Decimal> for U256
source§impl CheckedSub<Decimal> for U320
impl CheckedSub<Decimal> for U320
source§impl CheckedSub<Decimal> for U448
impl CheckedSub<Decimal> for U448
source§impl CheckedSub<Decimal> for U512
impl CheckedSub<Decimal> for U512
source§impl CheckedSub<I192> for Decimal
impl CheckedSub<I192> for Decimal
source§impl CheckedSub<I256> for Decimal
impl CheckedSub<I256> for Decimal
source§impl CheckedSub<I320> for Decimal
impl CheckedSub<I320> for Decimal
source§impl CheckedSub<I448> for Decimal
impl CheckedSub<I448> for Decimal
source§impl CheckedSub<I512> for Decimal
impl CheckedSub<I512> for Decimal
source§impl CheckedSub<PreciseDecimal> for Decimal
impl CheckedSub<PreciseDecimal> for Decimal
type Output = PreciseDecimal
fn checked_sub( self, other: PreciseDecimal ) -> Option<<Decimal as CheckedSub<PreciseDecimal>>::Output>
source§impl CheckedSub<U192> for Decimal
impl CheckedSub<U192> for Decimal
source§impl CheckedSub<U256> for Decimal
impl CheckedSub<U256> for Decimal
source§impl CheckedSub<U320> for Decimal
impl CheckedSub<U320> for Decimal
source§impl CheckedSub<U448> for Decimal
impl CheckedSub<U448> for Decimal
source§impl CheckedSub<U512> for Decimal
impl CheckedSub<U512> for Decimal
source§impl CheckedSub<i128> for Decimal
impl CheckedSub<i128> for Decimal
source§impl CheckedSub<i16> for Decimal
impl CheckedSub<i16> for Decimal
source§impl CheckedSub<i32> for Decimal
impl CheckedSub<i32> for Decimal
source§impl CheckedSub<i64> for Decimal
impl CheckedSub<i64> for Decimal
source§impl CheckedSub<i8> for Decimal
impl CheckedSub<i8> for Decimal
source§impl CheckedSub<isize> for Decimal
impl CheckedSub<isize> for Decimal
source§impl CheckedSub<u128> for Decimal
impl CheckedSub<u128> for Decimal
source§impl CheckedSub<u16> for Decimal
impl CheckedSub<u16> for Decimal
source§impl CheckedSub<u32> for Decimal
impl CheckedSub<u32> for Decimal
source§impl CheckedSub<u64> for Decimal
impl CheckedSub<u64> for Decimal
source§impl CheckedSub<u8> for Decimal
impl CheckedSub<u8> for Decimal
source§impl CheckedSub<usize> for Decimal
impl CheckedSub<usize> for Decimal
source§impl CheckedTruncate<Decimal> for PreciseDecimal
impl CheckedTruncate<Decimal> for PreciseDecimal
type Output = Decimal
fn checked_truncate( self, mode: RoundingMode ) -> Option<<PreciseDecimal as CheckedTruncate<Decimal>>::Output>
source§impl<D> Decode<ManifestCustomValueKind, D> for Decimalwhere
D: Decoder<ManifestCustomValueKind>,
impl<D> Decode<ManifestCustomValueKind, D> for Decimalwhere D: Decoder<ManifestCustomValueKind>,
source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<ManifestCustomValueKind>
) -> Result<Decimal, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ManifestCustomValueKind> ) -> Result<Decimal, DecodeError>
source§impl<D> Decode<ScryptoCustomValueKind, D> for Decimalwhere
D: Decoder<ScryptoCustomValueKind>,
impl<D> Decode<ScryptoCustomValueKind, D> for Decimalwhere D: Decoder<ScryptoCustomValueKind>,
source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<ScryptoCustomValueKind>
) -> Result<Decimal, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ScryptoCustomValueKind> ) -> Result<Decimal, DecodeError>
source§impl Describe<ScryptoCustomTypeKind> for Decimal
impl Describe<ScryptoCustomTypeKind> for Decimal
source§const TYPE_ID: RustTypeId = sbor::RustTypeId::WellKnown(crate::data::scrypto::well_known_scrypto_custom_types::DECIMAL_TYPE)
const TYPE_ID: RustTypeId = sbor::RustTypeId::WellKnown(crate::data::scrypto::well_known_scrypto_custom_types::DECIMAL_TYPE)
TYPE_ID
should give a unique identifier for its SBOR schema type.
An SBOR schema type capture details about the SBOR payload, how it should be interpreted, validated and displayed. Read moresource§fn type_data() -> TypeData<ScryptoCustomTypeKind, RustTypeId>
fn type_data() -> TypeData<ScryptoCustomTypeKind, RustTypeId>
source§fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
get_local_type_data
, we need to ensure that the type and all of its own references
get added to the aggregator. Read moresource§impl Div<Decimal> for PreciseDecimal
impl Div<Decimal> for PreciseDecimal
source§impl Div<PreciseDecimal> for Decimal
impl Div<PreciseDecimal> for Decimal
§type Output = PreciseDecimal
type Output = PreciseDecimal
/
operator.source§fn div(self, other: PreciseDecimal) -> <Decimal as Div<PreciseDecimal>>::Output
fn div(self, other: PreciseDecimal) -> <Decimal as Div<PreciseDecimal>>::Output
/
operation. Read moresource§impl DivAssign<Decimal> for Decimal
impl DivAssign<Decimal> for Decimal
source§fn div_assign(&mut self, other: Decimal)
fn div_assign(&mut self, other: Decimal)
/=
operation. Read moresource§impl DivAssign<Decimal> for PreciseDecimal
impl DivAssign<Decimal> for PreciseDecimal
source§fn div_assign(&mut self, other: Decimal)
fn div_assign(&mut self, other: Decimal)
/=
operation. Read moresource§impl DivAssign<I192> for Decimal
impl DivAssign<I192> for Decimal
source§fn div_assign(&mut self, other: I192)
fn div_assign(&mut self, other: I192)
/=
operation. Read moresource§impl DivAssign<I256> for Decimal
impl DivAssign<I256> for Decimal
source§fn div_assign(&mut self, other: I256)
fn div_assign(&mut self, other: I256)
/=
operation. Read moresource§impl DivAssign<I320> for Decimal
impl DivAssign<I320> for Decimal
source§fn div_assign(&mut self, other: I320)
fn div_assign(&mut self, other: I320)
/=
operation. Read moresource§impl DivAssign<I448> for Decimal
impl DivAssign<I448> for Decimal
source§fn div_assign(&mut self, other: I448)
fn div_assign(&mut self, other: I448)
/=
operation. Read moresource§impl DivAssign<I512> for Decimal
impl DivAssign<I512> for Decimal
source§fn div_assign(&mut self, other: I512)
fn div_assign(&mut self, other: I512)
/=
operation. Read moresource§impl DivAssign<U192> for Decimal
impl DivAssign<U192> for Decimal
source§fn div_assign(&mut self, other: U192)
fn div_assign(&mut self, other: U192)
/=
operation. Read moresource§impl DivAssign<U256> for Decimal
impl DivAssign<U256> for Decimal
source§fn div_assign(&mut self, other: U256)
fn div_assign(&mut self, other: U256)
/=
operation. Read moresource§impl DivAssign<U320> for Decimal
impl DivAssign<U320> for Decimal
source§fn div_assign(&mut self, other: U320)
fn div_assign(&mut self, other: U320)
/=
operation. Read moresource§impl DivAssign<U448> for Decimal
impl DivAssign<U448> for Decimal
source§fn div_assign(&mut self, other: U448)
fn div_assign(&mut self, other: U448)
/=
operation. Read moresource§impl DivAssign<U512> for Decimal
impl DivAssign<U512> for Decimal
source§fn div_assign(&mut self, other: U512)
fn div_assign(&mut self, other: U512)
/=
operation. Read moresource§impl DivAssign<i128> for Decimal
impl DivAssign<i128> for Decimal
source§fn div_assign(&mut self, other: i128)
fn div_assign(&mut self, other: i128)
/=
operation. Read moresource§impl DivAssign<i16> for Decimal
impl DivAssign<i16> for Decimal
source§fn div_assign(&mut self, other: i16)
fn div_assign(&mut self, other: i16)
/=
operation. Read moresource§impl DivAssign<i32> for Decimal
impl DivAssign<i32> for Decimal
source§fn div_assign(&mut self, other: i32)
fn div_assign(&mut self, other: i32)
/=
operation. Read moresource§impl DivAssign<i64> for Decimal
impl DivAssign<i64> for Decimal
source§fn div_assign(&mut self, other: i64)
fn div_assign(&mut self, other: i64)
/=
operation. Read moresource§impl DivAssign<i8> for Decimal
impl DivAssign<i8> for Decimal
source§fn div_assign(&mut self, other: i8)
fn div_assign(&mut self, other: i8)
/=
operation. Read moresource§impl DivAssign<isize> for Decimal
impl DivAssign<isize> for Decimal
source§fn div_assign(&mut self, other: isize)
fn div_assign(&mut self, other: isize)
/=
operation. Read moresource§impl DivAssign<u128> for Decimal
impl DivAssign<u128> for Decimal
source§fn div_assign(&mut self, other: u128)
fn div_assign(&mut self, other: u128)
/=
operation. Read moresource§impl DivAssign<u16> for Decimal
impl DivAssign<u16> for Decimal
source§fn div_assign(&mut self, other: u16)
fn div_assign(&mut self, other: u16)
/=
operation. Read moresource§impl DivAssign<u32> for Decimal
impl DivAssign<u32> for Decimal
source§fn div_assign(&mut self, other: u32)
fn div_assign(&mut self, other: u32)
/=
operation. Read moresource§impl DivAssign<u64> for Decimal
impl DivAssign<u64> for Decimal
source§fn div_assign(&mut self, other: u64)
fn div_assign(&mut self, other: u64)
/=
operation. Read moresource§impl DivAssign<u8> for Decimal
impl DivAssign<u8> for Decimal
source§fn div_assign(&mut self, other: u8)
fn div_assign(&mut self, other: u8)
/=
operation. Read moresource§impl DivAssign<usize> for Decimal
impl DivAssign<usize> for Decimal
source§fn div_assign(&mut self, other: usize)
fn div_assign(&mut self, other: usize)
/=
operation. Read moresource§impl<E> Encode<ManifestCustomValueKind, E> for Decimalwhere
E: Encoder<ManifestCustomValueKind>,
impl<E> Encode<ManifestCustomValueKind, E> for Decimalwhere E: Encoder<ManifestCustomValueKind>,
source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
source§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
source§impl<E> Encode<ScryptoCustomValueKind, E> for Decimalwhere
E: Encoder<ScryptoCustomValueKind>,
impl<E> Encode<ScryptoCustomValueKind, E> for Decimalwhere E: Encoder<ScryptoCustomValueKind>,
source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
source§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
source§impl ForWithdrawal for Decimal
impl ForWithdrawal for Decimal
fn for_withdrawal( &self, divisibility: u8, withdraw_strategy: WithdrawStrategy ) -> Option<Decimal>
source§impl From<Decimal> for PreciseDecimal
impl From<Decimal> for PreciseDecimal
source§fn from(val: Decimal) -> PreciseDecimal
fn from(val: Decimal) -> PreciseDecimal
source§impl MetadataVal for Decimal
impl MetadataVal for Decimal
const DISCRIMINATOR: u8 = 7u8
fn to_metadata_value( self ) -> GenericMetadataValue<UncheckedUrl, UncheckedOrigin>
fn from_metadata_value( entry: GenericMetadataValue<UncheckedUrl, UncheckedOrigin> ) -> Result<Decimal, MetadataConversionError>
source§impl Mul<Decimal> for PreciseDecimal
impl Mul<Decimal> for PreciseDecimal
source§impl Mul<PreciseDecimal> for Decimal
impl Mul<PreciseDecimal> for Decimal
§type Output = PreciseDecimal
type Output = PreciseDecimal
*
operator.source§fn mul(self, other: PreciseDecimal) -> <Decimal as Mul<PreciseDecimal>>::Output
fn mul(self, other: PreciseDecimal) -> <Decimal as Mul<PreciseDecimal>>::Output
*
operation. Read moresource§impl MulAssign<Decimal> for Decimal
impl MulAssign<Decimal> for Decimal
source§fn mul_assign(&mut self, other: Decimal)
fn mul_assign(&mut self, other: Decimal)
*=
operation. Read moresource§impl MulAssign<Decimal> for PreciseDecimal
impl MulAssign<Decimal> for PreciseDecimal
source§fn mul_assign(&mut self, other: Decimal)
fn mul_assign(&mut self, other: Decimal)
*=
operation. Read moresource§impl MulAssign<I192> for Decimal
impl MulAssign<I192> for Decimal
source§fn mul_assign(&mut self, other: I192)
fn mul_assign(&mut self, other: I192)
*=
operation. Read moresource§impl MulAssign<I256> for Decimal
impl MulAssign<I256> for Decimal
source§fn mul_assign(&mut self, other: I256)
fn mul_assign(&mut self, other: I256)
*=
operation. Read moresource§impl MulAssign<I320> for Decimal
impl MulAssign<I320> for Decimal
source§fn mul_assign(&mut self, other: I320)
fn mul_assign(&mut self, other: I320)
*=
operation. Read moresource§impl MulAssign<I448> for Decimal
impl MulAssign<I448> for Decimal
source§fn mul_assign(&mut self, other: I448)
fn mul_assign(&mut self, other: I448)
*=
operation. Read moresource§impl MulAssign<I512> for Decimal
impl MulAssign<I512> for Decimal
source§fn mul_assign(&mut self, other: I512)
fn mul_assign(&mut self, other: I512)
*=
operation. Read moresource§impl MulAssign<U192> for Decimal
impl MulAssign<U192> for Decimal
source§fn mul_assign(&mut self, other: U192)
fn mul_assign(&mut self, other: U192)
*=
operation. Read moresource§impl MulAssign<U256> for Decimal
impl MulAssign<U256> for Decimal
source§fn mul_assign(&mut self, other: U256)
fn mul_assign(&mut self, other: U256)
*=
operation. Read moresource§impl MulAssign<U320> for Decimal
impl MulAssign<U320> for Decimal
source§fn mul_assign(&mut self, other: U320)
fn mul_assign(&mut self, other: U320)
*=
operation. Read moresource§impl MulAssign<U448> for Decimal
impl MulAssign<U448> for Decimal
source§fn mul_assign(&mut self, other: U448)
fn mul_assign(&mut self, other: U448)
*=
operation. Read moresource§impl MulAssign<U512> for Decimal
impl MulAssign<U512> for Decimal
source§fn mul_assign(&mut self, other: U512)
fn mul_assign(&mut self, other: U512)
*=
operation. Read moresource§impl MulAssign<i128> for Decimal
impl MulAssign<i128> for Decimal
source§fn mul_assign(&mut self, other: i128)
fn mul_assign(&mut self, other: i128)
*=
operation. Read moresource§impl MulAssign<i16> for Decimal
impl MulAssign<i16> for Decimal
source§fn mul_assign(&mut self, other: i16)
fn mul_assign(&mut self, other: i16)
*=
operation. Read moresource§impl MulAssign<i32> for Decimal
impl MulAssign<i32> for Decimal
source§fn mul_assign(&mut self, other: i32)
fn mul_assign(&mut self, other: i32)
*=
operation. Read moresource§impl MulAssign<i64> for Decimal
impl MulAssign<i64> for Decimal
source§fn mul_assign(&mut self, other: i64)
fn mul_assign(&mut self, other: i64)
*=
operation. Read moresource§impl MulAssign<i8> for Decimal
impl MulAssign<i8> for Decimal
source§fn mul_assign(&mut self, other: i8)
fn mul_assign(&mut self, other: i8)
*=
operation. Read moresource§impl MulAssign<isize> for Decimal
impl MulAssign<isize> for Decimal
source§fn mul_assign(&mut self, other: isize)
fn mul_assign(&mut self, other: isize)
*=
operation. Read moresource§impl MulAssign<u128> for Decimal
impl MulAssign<u128> for Decimal
source§fn mul_assign(&mut self, other: u128)
fn mul_assign(&mut self, other: u128)
*=
operation. Read moresource§impl MulAssign<u16> for Decimal
impl MulAssign<u16> for Decimal
source§fn mul_assign(&mut self, other: u16)
fn mul_assign(&mut self, other: u16)
*=
operation. Read moresource§impl MulAssign<u32> for Decimal
impl MulAssign<u32> for Decimal
source§fn mul_assign(&mut self, other: u32)
fn mul_assign(&mut self, other: u32)
*=
operation. Read moresource§impl MulAssign<u64> for Decimal
impl MulAssign<u64> for Decimal
source§fn mul_assign(&mut self, other: u64)
fn mul_assign(&mut self, other: u64)
*=
operation. Read moresource§impl MulAssign<u8> for Decimal
impl MulAssign<u8> for Decimal
source§fn mul_assign(&mut self, other: u8)
fn mul_assign(&mut self, other: u8)
*=
operation. Read moresource§impl MulAssign<usize> for Decimal
impl MulAssign<usize> for Decimal
source§fn mul_assign(&mut self, other: usize)
fn mul_assign(&mut self, other: usize)
*=
operation. Read moresource§impl Ord for Decimal
impl Ord for Decimal
source§impl PartialEq<Decimal> for Decimal
impl PartialEq<Decimal> for Decimal
source§impl PartialOrd<Decimal> for Decimal
impl PartialOrd<Decimal> for Decimal
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl SingleMetadataVal for Decimal
impl SingleMetadataVal for Decimal
source§impl Sub<Decimal> for PreciseDecimal
impl Sub<Decimal> for PreciseDecimal
source§impl Sub<PreciseDecimal> for Decimal
impl Sub<PreciseDecimal> for Decimal
§type Output = PreciseDecimal
type Output = PreciseDecimal
-
operator.source§fn sub(self, other: PreciseDecimal) -> <Decimal as Sub<PreciseDecimal>>::Output
fn sub(self, other: PreciseDecimal) -> <Decimal as Sub<PreciseDecimal>>::Output
-
operation. Read moresource§impl SubAssign<Decimal> for Decimal
impl SubAssign<Decimal> for Decimal
source§fn sub_assign(&mut self, other: Decimal)
fn sub_assign(&mut self, other: Decimal)
-=
operation. Read moresource§impl SubAssign<Decimal> for PreciseDecimal
impl SubAssign<Decimal> for PreciseDecimal
source§fn sub_assign(&mut self, other: Decimal)
fn sub_assign(&mut self, other: Decimal)
-=
operation. Read moresource§impl SubAssign<I192> for Decimal
impl SubAssign<I192> for Decimal
source§fn sub_assign(&mut self, other: I192)
fn sub_assign(&mut self, other: I192)
-=
operation. Read moresource§impl SubAssign<I256> for Decimal
impl SubAssign<I256> for Decimal
source§fn sub_assign(&mut self, other: I256)
fn sub_assign(&mut self, other: I256)
-=
operation. Read moresource§impl SubAssign<I320> for Decimal
impl SubAssign<I320> for Decimal
source§fn sub_assign(&mut self, other: I320)
fn sub_assign(&mut self, other: I320)
-=
operation. Read moresource§impl SubAssign<I448> for Decimal
impl SubAssign<I448> for Decimal
source§fn sub_assign(&mut self, other: I448)
fn sub_assign(&mut self, other: I448)
-=
operation. Read moresource§impl SubAssign<I512> for Decimal
impl SubAssign<I512> for Decimal
source§fn sub_assign(&mut self, other: I512)
fn sub_assign(&mut self, other: I512)
-=
operation. Read moresource§impl SubAssign<U192> for Decimal
impl SubAssign<U192> for Decimal
source§fn sub_assign(&mut self, other: U192)
fn sub_assign(&mut self, other: U192)
-=
operation. Read moresource§impl SubAssign<U256> for Decimal
impl SubAssign<U256> for Decimal
source§fn sub_assign(&mut self, other: U256)
fn sub_assign(&mut self, other: U256)
-=
operation. Read moresource§impl SubAssign<U320> for Decimal
impl SubAssign<U320> for Decimal
source§fn sub_assign(&mut self, other: U320)
fn sub_assign(&mut self, other: U320)
-=
operation. Read moresource§impl SubAssign<U448> for Decimal
impl SubAssign<U448> for Decimal
source§fn sub_assign(&mut self, other: U448)
fn sub_assign(&mut self, other: U448)
-=
operation. Read moresource§impl SubAssign<U512> for Decimal
impl SubAssign<U512> for Decimal
source§fn sub_assign(&mut self, other: U512)
fn sub_assign(&mut self, other: U512)
-=
operation. Read moresource§impl SubAssign<i128> for Decimal
impl SubAssign<i128> for Decimal
source§fn sub_assign(&mut self, other: i128)
fn sub_assign(&mut self, other: i128)
-=
operation. Read moresource§impl SubAssign<i16> for Decimal
impl SubAssign<i16> for Decimal
source§fn sub_assign(&mut self, other: i16)
fn sub_assign(&mut self, other: i16)
-=
operation. Read moresource§impl SubAssign<i32> for Decimal
impl SubAssign<i32> for Decimal
source§fn sub_assign(&mut self, other: i32)
fn sub_assign(&mut self, other: i32)
-=
operation. Read moresource§impl SubAssign<i64> for Decimal
impl SubAssign<i64> for Decimal
source§fn sub_assign(&mut self, other: i64)
fn sub_assign(&mut self, other: i64)
-=
operation. Read moresource§impl SubAssign<i8> for Decimal
impl SubAssign<i8> for Decimal
source§fn sub_assign(&mut self, other: i8)
fn sub_assign(&mut self, other: i8)
-=
operation. Read moresource§impl SubAssign<isize> for Decimal
impl SubAssign<isize> for Decimal
source§fn sub_assign(&mut self, other: isize)
fn sub_assign(&mut self, other: isize)
-=
operation. Read moresource§impl SubAssign<u128> for Decimal
impl SubAssign<u128> for Decimal
source§fn sub_assign(&mut self, other: u128)
fn sub_assign(&mut self, other: u128)
-=
operation. Read moresource§impl SubAssign<u16> for Decimal
impl SubAssign<u16> for Decimal
source§fn sub_assign(&mut self, other: u16)
fn sub_assign(&mut self, other: u16)
-=
operation. Read moresource§impl SubAssign<u32> for Decimal
impl SubAssign<u32> for Decimal
source§fn sub_assign(&mut self, other: u32)
fn sub_assign(&mut self, other: u32)
-=
operation. Read moresource§impl SubAssign<u64> for Decimal
impl SubAssign<u64> for Decimal
source§fn sub_assign(&mut self, other: u64)
fn sub_assign(&mut self, other: u64)
-=
operation. Read moresource§impl SubAssign<u8> for Decimal
impl SubAssign<u8> for Decimal
source§fn sub_assign(&mut self, other: u8)
fn sub_assign(&mut self, other: u8)
-=
operation. Read moresource§impl SubAssign<usize> for Decimal
impl SubAssign<usize> for Decimal
source§fn sub_assign(&mut self, other: usize)
fn sub_assign(&mut self, other: usize)
-=
operation. Read moresource§impl ToMetadataEntry for Decimal
impl ToMetadataEntry for Decimal
fn to_metadata_entry( self ) -> Option<GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>
source§impl TryFrom<PreciseDecimal> for Decimal
impl TryFrom<PreciseDecimal> for Decimal
§type Error = ParseDecimalError
type Error = ParseDecimalError
source§fn try_from(
val: PreciseDecimal
) -> Result<Decimal, <Decimal as TryFrom<PreciseDecimal>>::Error>
fn try_from( val: PreciseDecimal ) -> Result<Decimal, <Decimal as TryFrom<PreciseDecimal>>::Error>
impl Copy for Decimal
impl Eq for Decimal
impl StructuralEq for Decimal
impl StructuralPartialEq for Decimal
Auto Trait Implementations§
impl RefUnwindSafe for Decimal
impl Send for Decimal
impl Sync for Decimal
impl Unpin for Decimal
impl UnwindSafe for Decimal
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.