pub struct Decimal256(/* private fields */);
Expand description
A fixed-point decimal value with 18 fractional digits, i.e. Decimal256(1_000_000_000_000_000_000) == 1.0
The greatest possible value that can be represented is 115792089237316195423570985008687907853269984665640564039457.584007913129639935 (which is (2^256 - 1) / 10^18)
Implementations§
Trait Implementations§
Source§impl Add for Decimal256
impl Add for Decimal256
Source§impl Clone for Decimal256
impl Clone for Decimal256
Source§fn clone(&self) -> Decimal256
fn clone(&self) -> Decimal256
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Decimal256
impl Debug for Decimal256
Source§impl Default for Decimal256
impl Default for Decimal256
Source§fn default() -> Decimal256
fn default() -> Decimal256
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Decimal256
Deserializes as a base64 string
impl<'de> Deserialize<'de> for Decimal256
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Decimal256
impl Display for Decimal256
Source§impl Div<Uint256> for Decimal256
impl Div<Uint256> for Decimal256
Source§impl DivAssign<Uint256> for Decimal256
impl DivAssign<Uint256> for Decimal256
Source§fn div_assign(&mut self, rhs: Uint256)
fn div_assign(&mut self, rhs: Uint256)
Performs the
/=
operation. Read moreSource§impl Fraction<Uint256> for Decimal256
impl Fraction<Uint256> for Decimal256
Source§impl FromStr for Decimal256
impl FromStr for Decimal256
Source§impl JsonSchema for Decimal256
impl JsonSchema for Decimal256
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl Mul<Decimal256> for Uint256
Both du and ud with d: Decimal256 and u: Uint256 returns an Uint256. There is no
specific reason for this decision other than the initial use cases we have. If you
need a Decimal256 result for the same calculation, use Decimal256(du) or Decimal256(ud).
impl Mul<Decimal256> for Uint256
Both du and ud with d: Decimal256 and u: Uint256 returns an Uint256. There is no specific reason for this decision other than the initial use cases we have. If you need a Decimal256 result for the same calculation, use Decimal256(du) or Decimal256(ud).
Source§impl Mul<Uint256> for Decimal256
impl Mul<Uint256> for Decimal256
Source§impl Ord for Decimal256
impl Ord for Decimal256
Source§fn cmp(&self, other: &Decimal256) -> Ordering
fn cmp(&self, other: &Decimal256) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Decimal256
impl PartialEq for Decimal256
Source§impl PartialOrd for Decimal256
impl PartialOrd for Decimal256
Source§impl Serialize for Decimal256
Serializes as a decimal string
impl Serialize for Decimal256
Serializes as a decimal string
Source§impl Sub for Decimal256
impl Sub for Decimal256
impl Copy for Decimal256
impl Eq for Decimal256
impl StructuralPartialEq for Decimal256
Auto Trait Implementations§
impl Freeze for Decimal256
impl RefUnwindSafe for Decimal256
impl Send for Decimal256
impl Sync for Decimal256
impl Unpin for Decimal256
impl UnwindSafe for Decimal256
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
Mutably borrows from an owned value. Read more