pub struct Decimal(/* private fields */);
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 there is underflow/overflow.
To create a Decimal with a certain number of 10^(-18)
subunits, use
Decimal::from_attos
or equivalently Decimal::from_subunits
.
Implementations§
Source§impl Decimal
impl Decimal
pub const ZERO: Self
pub const ONE_ATTO: Self
pub const ONE_SUBUNIT: Self = Self::ONE_ATTO
pub const ONE_HUNDREDTH: Self
pub const ONE_TENTH: Self
pub const ONE: Self
pub const TEN: Self
pub const ONE_HUNDRED: Self
Sourcepub const fn from_attos(attos: I192) -> Self
pub const fn from_attos(attos: I192) -> Self
Constructs a Decimal
from its underlying 10^(-18)
subunits.
Sourcepub const fn from_subunits(subunits: I192) -> Self
pub const fn from_subunits(subunits: I192) -> Self
Constructs a Decimal
from its underlying 10^(-18)
subunits.
This is an alias of from_attos
, for consistency with PreciseDecimal::from_precise_subunits
.
Sourcepub const fn subunits(self) -> I192
pub const fn subunits(self) -> I192
Returns the underlying 10^(-18)
subunits of the Decimal
.
This is an alias of attos
, for consistency with PreciseDecimal::precise_subunits
.
Sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Whether this value is positive.
Sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Whether this value is negative.
Sourcepub fn checked_abs(&self) -> Option<Self>
pub fn checked_abs(&self) -> Option<Self>
Returns the absolute value.
Sourcepub fn checked_floor(&self) -> Option<Self>
pub fn checked_floor(&self) -> Option<Self>
Returns the largest integer that is equal to or less than this number.
Sourcepub fn checked_ceiling(&self) -> Option<Self>
pub fn checked_ceiling(&self) -> Option<Self>
Returns the smallest integer that is equal to or greater than this number.
Sourcepub fn checked_round<T: Into<i32>>(
&self,
decimal_places: T,
mode: RoundingMode,
) -> Option<Self>
pub fn checked_round<T: Into<i32>>( &self, decimal_places: T, mode: RoundingMode, ) -> Option<Self>
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<Self>
pub fn checked_powi(&self, exp: i64) -> Option<Self>
Calculates power using exponentiation by squaring“.
Sourcepub fn checked_sqrt(&self) -> Option<Self>
pub fn checked_sqrt(&self) -> Option<Self>
Square root of a Decimal
Sourcepub fn checked_cbrt(&self) -> Option<Self>
pub fn checked_cbrt(&self) -> Option<Self>
Cubic root of a Decimal
Sourcepub fn checked_nth_root(&self, n: u32) -> Option<Self>
pub fn checked_nth_root(&self, n: u32) -> Option<Self>
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
Source§type Output = PreciseDecimal
type Output = PreciseDecimal
+
operator.Source§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 AddAssign for Decimal
impl AddAssign for Decimal
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
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 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<Self::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<Self::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 CheckedAdd for Decimal
impl CheckedAdd 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<Self::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<Self::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 CheckedDiv for Decimal
impl CheckedDiv 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<Self::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<Self::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 CheckedMul for Decimal
impl CheckedMul for Decimal
Source§impl CheckedNeg for Decimal
impl CheckedNeg 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<Self::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<Self::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 CheckedSub for Decimal
impl CheckedSub for Decimal
Source§impl CheckedTruncate<Decimal> for PreciseDecimal
impl CheckedTruncate<Decimal> for PreciseDecimal
type Output = Decimal
fn checked_truncate(self, mode: RoundingMode) -> Option<Self::Output>
Source§impl<D: Decoder<ManifestCustomValueKind>> Decode<ManifestCustomValueKind, D> for Decimal
impl<D: Decoder<ManifestCustomValueKind>> Decode<ManifestCustomValueKind, D> for Decimal
Source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<ManifestCustomValueKind>,
) -> Result<Self, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ManifestCustomValueKind>, ) -> Result<Self, DecodeError>
Source§impl<D: Decoder<ScryptoCustomValueKind>> Decode<ScryptoCustomValueKind, D> for Decimal
impl<D: Decoder<ScryptoCustomValueKind>> Decode<ScryptoCustomValueKind, D> for Decimal
Source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<ScryptoCustomValueKind>,
) -> Result<Self, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<ScryptoCustomValueKind>, ) -> Result<Self, DecodeError>
Source§impl Describe<ScryptoCustomTypeKind> for Decimal
impl Describe<ScryptoCustomTypeKind> for Decimal
Source§const TYPE_ID: RustTypeId
const TYPE_ID: RustTypeId
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
Source§type Output = PreciseDecimal
type Output = PreciseDecimal
/
operator.Source§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 DivAssign for Decimal
impl DivAssign for Decimal
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
/=
operation. Read moreSource§impl<E: Encoder<ManifestCustomValueKind>> Encode<ManifestCustomValueKind, E> for Decimal
impl<E: Encoder<ManifestCustomValueKind>> Encode<ManifestCustomValueKind, E> for Decimal
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: Encoder<ScryptoCustomValueKind>> Encode<ScryptoCustomValueKind, E> for Decimal
impl<E: Encoder<ScryptoCustomValueKind>> Encode<ScryptoCustomValueKind, E> for Decimal
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 From<Decimal> for PreciseDecimal
impl From<Decimal> for PreciseDecimal
Source§impl Mul<Decimal> for PreciseDecimal
impl Mul<Decimal> for PreciseDecimal
Source§impl Mul<PreciseDecimal> for Decimal
impl Mul<PreciseDecimal> for Decimal
Source§type Output = PreciseDecimal
type Output = PreciseDecimal
*
operator.Source§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 MulAssign for Decimal
impl MulAssign for Decimal
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
*=
operation. Read moreSource§impl Ord for Decimal
impl Ord for Decimal
Source§impl PartialOrd for Decimal
impl PartialOrd for Decimal
Source§impl<T: TryInto<Decimal, Error = E>, E: Debug> ResolveFrom<T> for Decimal
impl<T: TryInto<Decimal, Error = E>, E: Debug> ResolveFrom<T> for Decimal
fn resolve_from(value: T) -> Decimal
Source§impl SaturatingAdd for Decimal
impl SaturatingAdd for Decimal
Source§impl Sub<Decimal> for PreciseDecimal
impl Sub<Decimal> for PreciseDecimal
Source§impl Sub<PreciseDecimal> for Decimal
impl Sub<PreciseDecimal> for Decimal
Source§type Output = PreciseDecimal
type Output = PreciseDecimal
-
operator.Source§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 SubAssign for Decimal
impl SubAssign for Decimal
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moreSource§impl TryFrom<PreciseDecimal> for Decimal
impl TryFrom<PreciseDecimal> for Decimal
Source§type Error = ParseDecimalError
type Error = ParseDecimalError
impl Copy for Decimal
impl Eq for Decimal
impl Resolvable for Decimal
impl StructuralPartialEq for Decimal
Auto Trait Implementations§
impl Freeze for Decimal
impl RefUnwindSafe for Decimal
impl Send for Decimal
impl Sync for Decimal
impl Unpin for Decimal
impl UnwindSafe for Decimal
Blanket Implementations§
Source§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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.