pub trait UnsignedDecimal:
Display
+ Debug
+ Serialize
+ DeserializeOwned
+ Copy
+ Ord
+ FromStr
+ Default {
Show 13 methods
// Required methods
fn into_decimal256(self) -> Decimal256;
fn from_decimal256(src: Decimal256) -> Self;
// Provided methods
fn is_zero(&self) -> bool { ... }
fn checked_add(self, rhs: Self) -> Result<Self, OverflowError> { ... }
fn checked_add_signed(self, rhs: Signed<Self>) -> Result<Self> { ... }
fn checked_sub(self, rhs: Self) -> Result<Self, OverflowError> { ... }
fn try_from_number(_: Signed<Decimal256>) -> Result<Self> { ... }
fn into_number(self) -> Signed<Decimal256> { ... }
fn into_signed(self) -> Signed<Self> { ... }
fn zero() -> Self { ... }
fn two() -> Self { ... }
fn diff(self, rhs: Self) -> Self { ... }
fn approx_eq(self, rhs: Self) -> bool { ... }
}Expand description
Generalizes any newtype wrapper around a Decimal256.
Required Methods§
Sourcefn into_decimal256(self) -> Decimal256
fn into_decimal256(self) -> Decimal256
Convert into the underlying Decimal256.
Sourcefn from_decimal256(src: Decimal256) -> Self
fn from_decimal256(src: Decimal256) -> Self
Convert from a Decimal256.
Provided Methods§
Sourcefn checked_add(self, rhs: Self) -> Result<Self, OverflowError>
fn checked_add(self, rhs: Self) -> Result<Self, OverflowError>
Add two values together
Sourcefn checked_add_signed(self, rhs: Signed<Self>) -> Result<Self>
fn checked_add_signed(self, rhs: Signed<Self>) -> Result<Self>
Try to add a signed value to this, erroring if it results in a negative result.
Sourcefn checked_sub(self, rhs: Self) -> Result<Self, OverflowError>
fn checked_sub(self, rhs: Self) -> Result<Self, OverflowError>
Subtract two values
Sourcefn try_from_number(_: Signed<Decimal256>) -> Result<Self>
fn try_from_number(_: Signed<Decimal256>) -> Result<Self>
Try to convert from a general purpose Number
Sourcefn into_number(self) -> Signed<Decimal256>
fn into_number(self) -> Signed<Decimal256>
convert into a general purpose Number
Sourcefn into_signed(self) -> Signed<Self>
fn into_signed(self) -> Signed<Self>
Convert into a positive Signed value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.