pub struct Decimal(/* private fields */);
Expand description
A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0
The greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Decimal
Deserializes as a base64 string
impl<'de> Deserialize<'de> for Decimal
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 DivAssign<Uint128> for Decimal
impl DivAssign<Uint128> for Decimal
Source§fn div_assign(&mut self, rhs: Uint128)
fn div_assign(&mut self, rhs: Uint128)
Performs the
/=
operation. Read moreSource§impl FromStr for Decimal
impl FromStr for Decimal
Source§impl JsonSchema for Decimal
impl JsonSchema for Decimal
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<Decimal> for Uint128
Both du and ud with d: Decimal and u: Uint128 returns an Uint128. There is no
specific reason for this decision other than the initial use cases we have. If you
need a Decimal result for the same calculation, use Decimal(du) or Decimal(ud).
impl Mul<Decimal> for Uint128
Both du and ud with d: Decimal and u: Uint128 returns an Uint128. There is no specific reason for this decision other than the initial use cases we have. If you need a Decimal result for the same calculation, use Decimal(du) or Decimal(ud).
Source§impl Ord for Decimal
impl Ord for Decimal
Source§impl PartialOrd for Decimal
impl PartialOrd for Decimal
impl Copy for Decimal
impl Eq 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
Mutably borrows from an owned value. Read more