pub struct SignedDecimal {
pub decimal: Decimal,
pub negative: bool,
}
Fields§
§decimal: Decimal
§negative: bool
Implementations§
Source§impl SignedDecimal
impl SignedDecimal
pub const fn zero() -> Self
pub const fn one() -> Self
pub const fn new(decimal: Decimal) -> Self
pub const fn new_from_ptr(decimal: &Decimal) -> Self
pub const fn new_negative(decimal: Decimal) -> Self
pub const fn new_signed(decimal: Decimal, negative: bool) -> Self
pub fn from_atomics( atomics: impl Into<Uint128>, decimal_places: u32, negative: bool, ) -> Result<Self, DecimalRangeExceeded>
pub fn negation(&self) -> Self
pub fn is_zero(&self) -> bool
pub fn positive_part(&self) -> SignedDecimal
Trait Implementations§
Source§impl Add<&SignedDecimal> for &SignedDecimal
impl Add<&SignedDecimal> for &SignedDecimal
Source§type Output = <SignedDecimal as Add>::Output
type Output = <SignedDecimal as Add>::Output
The resulting type after applying the
+
operator.Source§fn add(
self,
other: &SignedDecimal,
) -> <SignedDecimal as Add<SignedDecimal>>::Output
fn add( self, other: &SignedDecimal, ) -> <SignedDecimal as Add<SignedDecimal>>::Output
Performs the
+
operation. Read moreSource§impl Add<&SignedDecimal> for SignedDecimal
impl Add<&SignedDecimal> for SignedDecimal
Source§type Output = <SignedDecimal as Add>::Output
type Output = <SignedDecimal as Add>::Output
The resulting type after applying the
+
operator.Source§fn add(
self,
other: &SignedDecimal,
) -> <SignedDecimal as Add<SignedDecimal>>::Output
fn add( self, other: &SignedDecimal, ) -> <SignedDecimal as Add<SignedDecimal>>::Output
Performs the
+
operation. Read moreSource§impl<'a> Add<SignedDecimal> for &'a SignedDecimal
impl<'a> Add<SignedDecimal> for &'a SignedDecimal
Source§type Output = <SignedDecimal as Add>::Output
type Output = <SignedDecimal as Add>::Output
The resulting type after applying the
+
operator.Source§fn add(
self,
other: SignedDecimal,
) -> <SignedDecimal as Add<SignedDecimal>>::Output
fn add( self, other: SignedDecimal, ) -> <SignedDecimal as Add<SignedDecimal>>::Output
Performs the
+
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)
Performs the
+=
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)
Performs the
+=
operation. Read moreSource§impl Clone for SignedDecimal
impl Clone for SignedDecimal
Source§fn clone(&self) -> SignedDecimal
fn clone(&self) -> SignedDecimal
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SignedDecimal
impl Debug for SignedDecimal
Source§impl<'de> Deserialize<'de> for SignedDecimal
impl<'de> Deserialize<'de> for SignedDecimal
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 SignedDecimal
impl Display for SignedDecimal
Source§impl Div for SignedDecimal
SignedDecimal / SignedDecimal
impl Div for SignedDecimal
SignedDecimal / SignedDecimal
Source§impl Fraction<Uint128> for SignedDecimal
impl Fraction<Uint128> for SignedDecimal
Source§impl JsonSchema for SignedDecimal
impl JsonSchema for SignedDecimal
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &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 for SignedDecimal
impl Mul 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,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SignedDecimal
impl PartialEq for SignedDecimal
Source§impl PartialOrd for SignedDecimal
impl PartialOrd for SignedDecimal
Source§impl Serialize for SignedDecimal
impl Serialize for SignedDecimal
Source§impl Sub<&SignedDecimal> for &SignedDecimal
impl Sub<&SignedDecimal> for &SignedDecimal
Source§type Output = <SignedDecimal as Sub>::Output
type Output = <SignedDecimal as Sub>::Output
The resulting type after applying the
-
operator.Source§fn sub(
self,
other: &SignedDecimal,
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
fn sub( self, other: &SignedDecimal, ) -> <SignedDecimal as Sub<SignedDecimal>>::Output
Performs the
-
operation. Read moreSource§impl Sub<&SignedDecimal> for SignedDecimal
impl Sub<&SignedDecimal> for SignedDecimal
Source§type Output = <SignedDecimal as Sub>::Output
type Output = <SignedDecimal as Sub>::Output
The resulting type after applying the
-
operator.Source§fn sub(
self,
other: &SignedDecimal,
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
fn sub( self, other: &SignedDecimal, ) -> <SignedDecimal as Sub<SignedDecimal>>::Output
Performs the
-
operation. Read moreSource§impl<'a> Sub<SignedDecimal> for &'a SignedDecimal
impl<'a> Sub<SignedDecimal> for &'a SignedDecimal
Source§type Output = <SignedDecimal as Sub>::Output
type Output = <SignedDecimal as Sub>::Output
The resulting type after applying the
-
operator.Source§fn sub(
self,
other: SignedDecimal,
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
fn sub( self, other: SignedDecimal, ) -> <SignedDecimal as Sub<SignedDecimal>>::Output
Performs the
-
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)
Performs the
-=
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)
Performs the
-=
operation. Read moreimpl 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
Mutably borrows from an owned value. Read more