Struct vortex_common::utils::SignedDecimal
source · Fields§
§decimal: Decimal§negative: boolImplementations§
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
§type Output = <SignedDecimal as Add<SignedDecimal>>::Output
type Output = <SignedDecimal as Add<SignedDecimal>>::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
§type Output = <SignedDecimal as Add<SignedDecimal>>::Output
type Output = <SignedDecimal as Add<SignedDecimal>>::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
§type Output = <SignedDecimal as Add<SignedDecimal>>::Output
type Output = <SignedDecimal as Add<SignedDecimal>>::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§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<SignedDecimal> for SignedDecimal
impl AddAssign<SignedDecimal> 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 copy 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 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<SignedDecimal> for SignedDecimal
impl Div<SignedDecimal> 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 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<SignedDecimal> for SignedDecimal
impl Mul<SignedDecimal> 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<SignedDecimal> for SignedDecimal
impl PartialEq<SignedDecimal> for SignedDecimal
source§fn eq(&self, other: &SignedDecimal) -> bool
fn eq(&self, other: &SignedDecimal) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<SignedDecimal> for SignedDecimal
impl PartialOrd<SignedDecimal> for SignedDecimal
source§fn partial_cmp(&self, other: &SignedDecimal) -> Option<Ordering>
fn partial_cmp(&self, other: &SignedDecimal) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for SignedDecimal
impl Serialize for SignedDecimal
source§impl Sub<&SignedDecimal> for &SignedDecimal
impl Sub<&SignedDecimal> for &SignedDecimal
§type Output = <SignedDecimal as Sub<SignedDecimal>>::Output
type Output = <SignedDecimal as Sub<SignedDecimal>>::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
§type Output = <SignedDecimal as Sub<SignedDecimal>>::Output
type Output = <SignedDecimal as Sub<SignedDecimal>>::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
§type Output = <SignedDecimal as Sub<SignedDecimal>>::Output
type Output = <SignedDecimal as Sub<SignedDecimal>>::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§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<SignedDecimal> for SignedDecimal
impl SubAssign<SignedDecimal> for SignedDecimal
source§fn sub_assign(&mut self, rhs: SignedDecimal)
fn sub_assign(&mut self, rhs: SignedDecimal)
Performs the
-= operation. Read more