Struct cosmwasm_std::SignedDecimal 
source · pub struct SignedDecimal(/* private fields */);Expand description
A signed fixed-point decimal value with 18 fractional digits, i.e. SignedDecimal(1_000_000_000_000_000_000) == 1.0
The greatest possible value that can be represented is 170141183460469231731.687303715884105727 (which is (2^127 - 1) / 10^18) and the smallest is -170141183460469231731.687303715884105728 (which is -2^127 / 10^18).
Implementations§
source§impl SignedDecimal
 
impl SignedDecimal
sourcepub const DECIMAL_PLACES: u32 = 18u32
 
pub const DECIMAL_PLACES: u32 = 18u32
The number of decimal places. Since decimal types are fixed-point rather than floating-point, this is a constant.
sourcepub const MAX: Self = _
 
pub const MAX: Self = _
The largest value that can be represented by this signed decimal type.
§Examples
assert_eq!(SignedDecimal::MAX.to_string(), "170141183460469231731.687303715884105727");sourcepub const MIN: Self = _
 
pub const MIN: Self = _
The smallest value that can be represented by this signed decimal type.
§Examples
assert_eq!(SignedDecimal::MIN.to_string(), "-170141183460469231731.687303715884105728");sourcepub const fn new(value: Int128) -> Self
 
pub const fn new(value: Int128) -> Self
Creates a SignedDecimal(value)
This is equivalent to SignedDecimal::from_atomics(value, 18) but usable in a const context.
§Examples
assert_eq!(SignedDecimal::new(Int128::one()).to_string(), "0.000000000000000001");sourcepub const fn raw(value: i128) -> Self
 
pub const fn raw(value: i128) -> Self
Creates a SignedDecimal(Int128(value))
This is equivalent to SignedDecimal::from_atomics(value, 18) but usable in a const context.
§Examples
assert_eq!(SignedDecimal::raw(1234i128).to_string(), "0.000000000000001234");sourcepub const fn negative_one() -> Self
 
pub const fn negative_one() -> Self
Create a -1.0 SignedDecimal
sourcepub fn from_atomics(
    atomics: impl Into<Int128>,
    decimal_places: u32,
) -> Result<Self, SignedDecimalRangeExceeded>
 
pub fn from_atomics( atomics: impl Into<Int128>, decimal_places: u32, ) -> Result<Self, SignedDecimalRangeExceeded>
Creates a signed decimal from a number of atomic units and the number of decimal places. The inputs will be converted internally to form a signed decimal with 18 decimal places. So the input 123 and 2 will create the decimal 1.23.
Using 18 decimal places is slightly more efficient than other values as no internal conversion is necessary.
§Examples
let a = SignedDecimal::from_atomics(Int128::new(1234), 3).unwrap();
assert_eq!(a.to_string(), "1.234");
let a = SignedDecimal::from_atomics(1234i128, 0).unwrap();
assert_eq!(a.to_string(), "1234");
let a = SignedDecimal::from_atomics(1i64, 18).unwrap();
assert_eq!(a.to_string(), "0.000000000000000001");
let a = SignedDecimal::from_atomics(-1i64, 18).unwrap();
assert_eq!(a.to_string(), "-0.000000000000000001");sourcepub fn from_ratio(
    numerator: impl Into<Int128>,
    denominator: impl Into<Int128>,
) -> Self
 
pub fn from_ratio( numerator: impl Into<Int128>, denominator: impl Into<Int128>, ) -> Self
Returns the ratio (numerator / denominator) as a SignedDecimal
§Examples
assert_eq!(
    SignedDecimal::from_ratio(1, 3).to_string(),
    "0.333333333333333333"
);sourcepub fn checked_from_ratio(
    numerator: impl Into<Int128>,
    denominator: impl Into<Int128>,
) -> Result<Self, CheckedFromRatioError>
 
pub fn checked_from_ratio( numerator: impl Into<Int128>, denominator: impl Into<Int128>, ) -> Result<Self, CheckedFromRatioError>
Returns the ratio (numerator / denominator) as a SignedDecimal
§Examples
assert_eq!(
    SignedDecimal::checked_from_ratio(1, 3).unwrap().to_string(),
    "0.333333333333333333"
);
assert_eq!(
    SignedDecimal::checked_from_ratio(1, 0),
    Err(CheckedFromRatioError::DivideByZero)
);sourcepub const fn is_negative(&self) -> bool
 
pub const fn is_negative(&self) -> bool
Returns true if the number is negative (< 0)
sourcepub const fn atomics(&self) -> Int128
 
pub const fn atomics(&self) -> Int128
A decimal is an integer of atomic units plus a number that specifies the position of the decimal dot. So any decimal can be expressed as two numbers.
§Examples
// Value with whole and fractional part
let a = SignedDecimal::from_str("1.234").unwrap();
assert_eq!(a.decimal_places(), 18);
assert_eq!(a.atomics(), Int128::new(1234000000000000000));
// Smallest possible value
let b = SignedDecimal::from_str("0.000000000000000001").unwrap();
assert_eq!(b.decimal_places(), 18);
assert_eq!(b.atomics(), Int128::new(1));sourcepub const fn decimal_places(&self) -> u32
 
pub const fn decimal_places(&self) -> u32
The number of decimal places. This is a constant value for now but this could potentially change as the type evolves.
See also SignedDecimal::atomics().
sourcepub fn trunc(&self) -> Self
 
pub fn trunc(&self) -> Self
Rounds value by truncating the decimal places.
§Examples
assert!(SignedDecimal::from_str("0.6").unwrap().trunc().is_zero());
assert_eq!(SignedDecimal::from_str("-5.8").unwrap().trunc().to_string(), "-5");sourcepub fn floor(&self) -> Self
 
pub fn floor(&self) -> Self
Rounds value down after decimal places. Panics on overflow.
§Examples
assert!(SignedDecimal::from_str("0.6").unwrap().floor().is_zero());
assert_eq!(SignedDecimal::from_str("-5.2").unwrap().floor().to_string(), "-6");sourcepub fn checked_floor(&self) -> Result<Self, RoundDownOverflowError>
 
pub fn checked_floor(&self) -> Result<Self, RoundDownOverflowError>
Rounds value down after decimal places.
sourcepub fn ceil(&self) -> Self
 
pub fn ceil(&self) -> Self
Rounds value up after decimal places. Panics on overflow.
§Examples
assert_eq!(SignedDecimal::from_str("0.2").unwrap().ceil(), SignedDecimal::one());
assert_eq!(SignedDecimal::from_str("-5.8").unwrap().ceil().to_string(), "-5");sourcepub fn checked_ceil(&self) -> Result<Self, RoundUpOverflowError>
 
pub fn checked_ceil(&self) -> Result<Self, RoundUpOverflowError>
Rounds value up after decimal places. Returns OverflowError on overflow.
sourcepub fn checked_add(self, other: Self) -> Result<Self, OverflowError>
 
pub fn checked_add(self, other: Self) -> Result<Self, OverflowError>
Computes self + other, returning an OverflowError if an overflow occurred.
sourcepub fn checked_sub(self, other: Self) -> Result<Self, OverflowError>
 
pub fn checked_sub(self, other: Self) -> Result<Self, OverflowError>
Computes self - other, returning an OverflowError if an overflow occurred.
sourcepub fn checked_mul(self, other: Self) -> Result<Self, OverflowError>
 
pub fn checked_mul(self, other: Self) -> Result<Self, OverflowError>
Multiplies one SignedDecimal by another, returning an OverflowError if an overflow occurred.
sourcepub fn pow(self, exp: u32) -> Self
 
pub fn pow(self, exp: u32) -> Self
Raises a value to the power of exp, panics if an overflow occurred.
sourcepub fn checked_pow(self, exp: u32) -> Result<Self, OverflowError>
 
pub fn checked_pow(self, exp: u32) -> Result<Self, OverflowError>
Raises a value to the power of exp, returning an OverflowError if an overflow occurred.
pub fn checked_div(self, other: Self) -> Result<Self, CheckedFromRatioError>
sourcepub fn checked_rem(self, other: Self) -> Result<Self, DivideByZeroError>
 
pub fn checked_rem(self, other: Self) -> Result<Self, DivideByZeroError>
Computes self % other, returning an DivideByZeroError if other == 0.
pub const fn abs_diff(self, other: Self) -> Decimal
pub fn saturating_add(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_mul(self, other: Self) -> Self
pub fn saturating_pow(self, exp: u32) -> Self
sourcepub fn to_int_floor(self) -> Int128
 
pub fn to_int_floor(self) -> Int128
Converts this decimal to a signed integer by rounding down to the next integer, e.g. 22.5 becomes 22 and -1.2 becomes -2.
§Examples
use core::str::FromStr;
use cosmwasm_std::{SignedDecimal, Int128};
let d = SignedDecimal::from_str("12.345").unwrap();
assert_eq!(d.to_int_floor(), Int128::new(12));
let d = SignedDecimal::from_str("-12.999").unwrap();
assert_eq!(d.to_int_floor(), Int128::new(-13));
let d = SignedDecimal::from_str("-0.05").unwrap();
assert_eq!(d.to_int_floor(), Int128::new(-1));sourcepub fn to_int_trunc(self) -> Int128
 
pub fn to_int_trunc(self) -> Int128
Converts this decimal to a signed integer by truncating the fractional part, e.g. 22.5 becomes 22.
§Examples
use core::str::FromStr;
use cosmwasm_std::{SignedDecimal, Int128};
let d = SignedDecimal::from_str("12.345").unwrap();
assert_eq!(d.to_int_trunc(), Int128::new(12));
let d = SignedDecimal::from_str("-12.999").unwrap();
assert_eq!(d.to_int_trunc(), Int128::new(-12));
let d = SignedDecimal::from_str("75.0").unwrap();
assert_eq!(d.to_int_trunc(), Int128::new(75));sourcepub fn to_int_ceil(self) -> Int128
 
pub fn to_int_ceil(self) -> Int128
Converts this decimal to a signed integer by rounding up to the next integer, e.g. 22.3 becomes 23 and -1.2 becomes -1.
§Examples
use core::str::FromStr;
use cosmwasm_std::{SignedDecimal, Int128};
let d = SignedDecimal::from_str("12.345").unwrap();
assert_eq!(d.to_int_ceil(), Int128::new(13));
let d = SignedDecimal::from_str("-12.999").unwrap();
assert_eq!(d.to_int_ceil(), Int128::new(-12));
let d = SignedDecimal::from_str("75.0").unwrap();
assert_eq!(d.to_int_ceil(), Int128::new(75));Trait Implementations§
source§impl Add<&SignedDecimal> for &SignedDecimal
 
impl Add<&SignedDecimal> for &SignedDecimal
§type Output = <SignedDecimal as Add>::Output
 
type Output = <SignedDecimal as Add>::Output
+ operator.source§fn add(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Add<SignedDecimal>>::Output
 
fn add( self, other: &SignedDecimal, ) -> <SignedDecimal as Add<SignedDecimal>>::Output
+ operation. Read moresource§impl Add<&SignedDecimal> for SignedDecimal
 
impl Add<&SignedDecimal> for SignedDecimal
§type Output = <SignedDecimal as Add>::Output
 
type Output = <SignedDecimal as Add>::Output
+ operator.source§fn add(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Add<SignedDecimal>>::Output
 
fn add( self, other: &SignedDecimal, ) -> <SignedDecimal as Add<SignedDecimal>>::Output
+ operation. Read moresource§impl<'a> Add<SignedDecimal> for &'a SignedDecimal
 
impl<'a> Add<SignedDecimal> for &'a SignedDecimal
§type Output = <SignedDecimal as Add>::Output
 
type Output = <SignedDecimal as Add>::Output
+ operator.source§fn add(
    self,
    other: SignedDecimal,
) -> <SignedDecimal as Add<SignedDecimal>>::Output
 
fn add( self, other: SignedDecimal, ) -> <SignedDecimal as Add<SignedDecimal>>::Output
+ operation. Read moresource§impl Add for SignedDecimal
 
impl Add for SignedDecimal
source§impl AddAssign<&SignedDecimal> for SignedDecimal
 
impl AddAssign<&SignedDecimal> for SignedDecimal
source§fn add_assign(&mut self, other: &SignedDecimal)
 
fn add_assign(&mut self, other: &SignedDecimal)
+= operation. Read moresource§impl AddAssign for SignedDecimal
 
impl AddAssign for SignedDecimal
source§fn add_assign(&mut self, rhs: SignedDecimal)
 
fn add_assign(&mut self, rhs: SignedDecimal)
+= operation. Read moresource§impl Clone for SignedDecimal
 
impl Clone for SignedDecimal
source§fn clone(&self) -> SignedDecimal
 
fn clone(&self) -> SignedDecimal
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for SignedDecimal
 
impl Debug for SignedDecimal
source§impl Default for SignedDecimal
 
impl Default for SignedDecimal
source§fn default() -> SignedDecimal
 
fn default() -> SignedDecimal
source§impl<'de> Deserialize<'de> for SignedDecimal
 
impl<'de> Deserialize<'de> for SignedDecimal
Deserializes as a base64 string
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
    D: Deserializer<'de>,
 
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
    D: Deserializer<'de>,
source§impl Display for SignedDecimal
 
impl Display for SignedDecimal
source§impl Div<&SignedDecimal> for &SignedDecimal
 
impl Div<&SignedDecimal> for &SignedDecimal
§type Output = <SignedDecimal as Div>::Output
 
type Output = <SignedDecimal as Div>::Output
/ operator.source§fn div(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Div<SignedDecimal>>::Output
 
fn div( self, other: &SignedDecimal, ) -> <SignedDecimal as Div<SignedDecimal>>::Output
/ operation. Read moresource§impl Div<&SignedDecimal> for SignedDecimal
 
impl Div<&SignedDecimal> for SignedDecimal
§type Output = <SignedDecimal as Div>::Output
 
type Output = <SignedDecimal as Div>::Output
/ operator.source§fn div(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Div<SignedDecimal>>::Output
 
fn div( self, other: &SignedDecimal, ) -> <SignedDecimal as Div<SignedDecimal>>::Output
/ operation. Read moresource§impl Div<Int128> for SignedDecimal
 
impl Div<Int128> for SignedDecimal
source§impl<'a> Div<SignedDecimal> for &'a SignedDecimal
 
impl<'a> Div<SignedDecimal> for &'a SignedDecimal
§type Output = <SignedDecimal as Div>::Output
 
type Output = <SignedDecimal as Div>::Output
/ operator.source§fn div(
    self,
    other: SignedDecimal,
) -> <SignedDecimal as Div<SignedDecimal>>::Output
 
fn div( self, other: SignedDecimal, ) -> <SignedDecimal as Div<SignedDecimal>>::Output
/ operation. Read moresource§impl Div for SignedDecimal
 
impl Div for SignedDecimal
source§impl DivAssign<&SignedDecimal> for SignedDecimal
 
impl DivAssign<&SignedDecimal> for SignedDecimal
source§fn div_assign(&mut self, other: &SignedDecimal)
 
fn div_assign(&mut self, other: &SignedDecimal)
/= operation. Read moresource§impl DivAssign<Int128> for SignedDecimal
 
impl DivAssign<Int128> for SignedDecimal
source§fn div_assign(&mut self, rhs: Int128)
 
fn div_assign(&mut self, rhs: Int128)
/= operation. Read moresource§impl DivAssign for SignedDecimal
 
impl DivAssign for SignedDecimal
source§fn div_assign(&mut self, rhs: SignedDecimal)
 
fn div_assign(&mut self, rhs: SignedDecimal)
/= operation. Read moresource§impl Fraction<Int128> for SignedDecimal
 
impl Fraction<Int128> for SignedDecimal
source§impl From<SignedDecimal> for SignedDecimal256
 
impl From<SignedDecimal> for SignedDecimal256
source§fn from(value: SignedDecimal) -> Self
 
fn from(value: SignedDecimal) -> Self
source§impl FromStr for SignedDecimal
 
impl FromStr for SignedDecimal
source§fn from_str(input: &str) -> Result<Self, Self::Err>
 
fn from_str(input: &str) -> Result<Self, Self::Err>
Converts the decimal string to a SignedDecimal Possible inputs: “1.23”, “1”, “000012”, “1.123000000”, “-1.12300” Disallowed: “”, “.23”
This never performs any kind of rounding. More than DECIMAL_PLACES fractional digits, even zeros, result in an error.
source§impl JsonSchema for SignedDecimal
 
impl JsonSchema for SignedDecimal
source§fn schema_name() -> String
 
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
 
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
 
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
 
fn is_referenceable() -> bool
$ref keyword. Read moresource§impl Mul<&SignedDecimal> for &SignedDecimal
 
impl Mul<&SignedDecimal> for &SignedDecimal
§type Output = <SignedDecimal as Mul>::Output
 
type Output = <SignedDecimal as Mul>::Output
* operator.source§fn mul(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Mul<SignedDecimal>>::Output
 
fn mul( self, other: &SignedDecimal, ) -> <SignedDecimal as Mul<SignedDecimal>>::Output
* operation. Read moresource§impl Mul<&SignedDecimal> for SignedDecimal
 
impl Mul<&SignedDecimal> for SignedDecimal
§type Output = <SignedDecimal as Mul>::Output
 
type Output = <SignedDecimal as Mul>::Output
* operator.source§fn mul(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Mul<SignedDecimal>>::Output
 
fn mul( self, other: &SignedDecimal, ) -> <SignedDecimal as Mul<SignedDecimal>>::Output
* operation. Read moresource§impl<'a> Mul<SignedDecimal> for &'a SignedDecimal
 
impl<'a> Mul<SignedDecimal> for &'a SignedDecimal
§type Output = <SignedDecimal as Mul>::Output
 
type Output = <SignedDecimal as Mul>::Output
* operator.source§fn mul(
    self,
    other: SignedDecimal,
) -> <SignedDecimal as Mul<SignedDecimal>>::Output
 
fn mul( self, other: SignedDecimal, ) -> <SignedDecimal as Mul<SignedDecimal>>::Output
* operation. Read moresource§impl Mul for SignedDecimal
 
impl Mul for SignedDecimal
source§impl MulAssign<&SignedDecimal> for SignedDecimal
 
impl MulAssign<&SignedDecimal> for SignedDecimal
source§fn mul_assign(&mut self, other: &SignedDecimal)
 
fn mul_assign(&mut self, other: &SignedDecimal)
*= operation. Read moresource§impl MulAssign for SignedDecimal
 
impl MulAssign for SignedDecimal
source§fn mul_assign(&mut self, rhs: SignedDecimal)
 
fn mul_assign(&mut self, rhs: SignedDecimal)
*= operation. Read moresource§impl Neg for SignedDecimal
 
impl Neg for SignedDecimal
source§impl Ord for SignedDecimal
 
impl Ord for SignedDecimal
source§fn cmp(&self, other: &SignedDecimal) -> Ordering
 
fn cmp(&self, other: &SignedDecimal) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
source§impl PartialEq<&SignedDecimal> for SignedDecimal
 
impl PartialEq<&SignedDecimal> for SignedDecimal
source§impl<'a> PartialEq<SignedDecimal> for &'a SignedDecimal
 
impl<'a> PartialEq<SignedDecimal> for &'a SignedDecimal
source§impl PartialEq for SignedDecimal
 
impl PartialEq for SignedDecimal
source§impl PartialOrd for SignedDecimal
 
impl PartialOrd for SignedDecimal
source§impl Rem<&SignedDecimal> for &SignedDecimal
 
impl Rem<&SignedDecimal> for &SignedDecimal
§type Output = <SignedDecimal as Rem>::Output
 
type Output = <SignedDecimal as Rem>::Output
% operator.source§fn rem(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Rem<SignedDecimal>>::Output
 
fn rem( self, other: &SignedDecimal, ) -> <SignedDecimal as Rem<SignedDecimal>>::Output
% operation. Read moresource§impl Rem<&SignedDecimal> for SignedDecimal
 
impl Rem<&SignedDecimal> for SignedDecimal
§type Output = <SignedDecimal as Rem>::Output
 
type Output = <SignedDecimal as Rem>::Output
% operator.source§fn rem(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Rem<SignedDecimal>>::Output
 
fn rem( self, other: &SignedDecimal, ) -> <SignedDecimal as Rem<SignedDecimal>>::Output
% operation. Read moresource§impl<'a> Rem<SignedDecimal> for &'a SignedDecimal
 
impl<'a> Rem<SignedDecimal> for &'a SignedDecimal
§type Output = <SignedDecimal as Rem>::Output
 
type Output = <SignedDecimal as Rem>::Output
% operator.source§fn rem(
    self,
    other: SignedDecimal,
) -> <SignedDecimal as Rem<SignedDecimal>>::Output
 
fn rem( self, other: SignedDecimal, ) -> <SignedDecimal as Rem<SignedDecimal>>::Output
% operation. Read moresource§impl Rem for SignedDecimal
 
impl Rem for SignedDecimal
source§impl RemAssign<&SignedDecimal> for SignedDecimal
 
impl RemAssign<&SignedDecimal> for SignedDecimal
source§fn rem_assign(&mut self, other: &SignedDecimal)
 
fn rem_assign(&mut self, other: &SignedDecimal)
%= operation. Read moresource§impl RemAssign for SignedDecimal
 
impl RemAssign for SignedDecimal
source§fn rem_assign(&mut self, rhs: SignedDecimal)
 
fn rem_assign(&mut self, rhs: SignedDecimal)
%= operation. Read moresource§impl Serialize for SignedDecimal
 
impl Serialize for SignedDecimal
Serializes as a decimal string
source§impl Sub<&SignedDecimal> for &SignedDecimal
 
impl Sub<&SignedDecimal> for &SignedDecimal
§type Output = <SignedDecimal as Sub>::Output
 
type Output = <SignedDecimal as Sub>::Output
- operator.source§fn sub(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
 
fn sub( self, other: &SignedDecimal, ) -> <SignedDecimal as Sub<SignedDecimal>>::Output
- operation. Read moresource§impl Sub<&SignedDecimal> for SignedDecimal
 
impl Sub<&SignedDecimal> for SignedDecimal
§type Output = <SignedDecimal as Sub>::Output
 
type Output = <SignedDecimal as Sub>::Output
- operator.source§fn sub(
    self,
    other: &SignedDecimal,
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
 
fn sub( self, other: &SignedDecimal, ) -> <SignedDecimal as Sub<SignedDecimal>>::Output
- operation. Read moresource§impl<'a> Sub<SignedDecimal> for &'a SignedDecimal
 
impl<'a> Sub<SignedDecimal> for &'a SignedDecimal
§type Output = <SignedDecimal as Sub>::Output
 
type Output = <SignedDecimal as Sub>::Output
- operator.source§fn sub(
    self,
    other: SignedDecimal,
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
 
fn sub( self, other: SignedDecimal, ) -> <SignedDecimal as Sub<SignedDecimal>>::Output
- operation. Read moresource§impl Sub for SignedDecimal
 
impl Sub for SignedDecimal
source§impl SubAssign<&SignedDecimal> for SignedDecimal
 
impl SubAssign<&SignedDecimal> for SignedDecimal
source§fn sub_assign(&mut self, other: &SignedDecimal)
 
fn sub_assign(&mut self, other: &SignedDecimal)
-= operation. Read moresource§impl SubAssign for SignedDecimal
 
impl SubAssign for SignedDecimal
source§fn sub_assign(&mut self, rhs: SignedDecimal)
 
fn sub_assign(&mut self, rhs: SignedDecimal)
-= operation. Read moresource§impl<A> Sum<A> for SignedDecimalwhere
    Self: Add<A, Output = Self>,
 
impl<A> Sum<A> for SignedDecimalwhere
    Self: Add<A, Output = Self>,
source§impl TryFrom<Decimal> for SignedDecimal
 
impl TryFrom<Decimal> for SignedDecimal
source§impl TryFrom<Decimal256> for SignedDecimal
 
impl TryFrom<Decimal256> for SignedDecimal
§type Error = SignedDecimalRangeExceeded
 
type Error = SignedDecimalRangeExceeded
source§impl TryFrom<SignedDecimal> for Decimal
 
impl TryFrom<SignedDecimal> for Decimal
§type Error = DecimalRangeExceeded
 
type Error = DecimalRangeExceeded
source§impl TryFrom<SignedDecimal> for Decimal256
 
impl TryFrom<SignedDecimal> for Decimal256
§type Error = Decimal256RangeExceeded
 
type Error = Decimal256RangeExceeded
source§impl TryFrom<SignedDecimal256> for SignedDecimal
 
impl TryFrom<SignedDecimal256> for SignedDecimal
§type Error = SignedDecimalRangeExceeded
 
type Error = SignedDecimalRangeExceeded
impl Copy for SignedDecimal
impl Eq for SignedDecimal
impl StructuralPartialEq for SignedDecimal
Auto Trait Implementations§
impl Freeze for SignedDecimal
impl RefUnwindSafe for SignedDecimal
impl Send for SignedDecimal
impl Sync for SignedDecimal
impl Unpin for SignedDecimal
impl UnwindSafe for SignedDecimal
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
 
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
    T: Copy,
 
impl<T> CloneToUninit for Twhere
    T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
 
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)