Struct vortex_common::utils::SignedDecimal
source · [−]Fields
decimal: Decimalnegative: boolImplementations
sourceimpl 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
sourceimpl 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.
sourcefn add(
self,
other: &SignedDecimal
) -> <SignedDecimal as Add<SignedDecimal>>::Output
fn add(
self,
other: &SignedDecimal
) -> <SignedDecimal as Add<SignedDecimal>>::Output
Performs the + operation. Read more
sourceimpl 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.
sourcefn add(
self,
other: &SignedDecimal
) -> <SignedDecimal as Add<SignedDecimal>>::Output
fn add(
self,
other: &SignedDecimal
) -> <SignedDecimal as Add<SignedDecimal>>::Output
Performs the + operation. Read more
sourceimpl<'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.
sourcefn add(
self,
other: SignedDecimal
) -> <SignedDecimal as Add<SignedDecimal>>::Output
fn add(
self,
other: SignedDecimal
) -> <SignedDecimal as Add<SignedDecimal>>::Output
Performs the + operation. Read more
sourceimpl Add<SignedDecimal> for SignedDecimal
impl Add<SignedDecimal> for SignedDecimal
type Output = SignedDecimal
type Output = SignedDecimal
The resulting type after applying the + operator.
sourceimpl AddAssign<&SignedDecimal> for SignedDecimal
impl AddAssign<&SignedDecimal> for SignedDecimal
sourcefn add_assign(&mut self, other: &SignedDecimal)
fn add_assign(&mut self, other: &SignedDecimal)
Performs the += operation. Read more
sourceimpl AddAssign<SignedDecimal> for SignedDecimal
impl AddAssign<SignedDecimal> for SignedDecimal
sourcefn add_assign(&mut self, rhs: SignedDecimal)
fn add_assign(&mut self, rhs: SignedDecimal)
Performs the += operation. Read more
sourceimpl Clone for SignedDecimal
impl Clone for SignedDecimal
sourcefn clone(&self) -> SignedDecimal
fn clone(&self) -> SignedDecimal
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for SignedDecimal
impl Debug for SignedDecimal
sourceimpl<'de> Deserialize<'de> for SignedDecimal
impl<'de> Deserialize<'de> for SignedDecimal
sourcefn 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
sourceimpl Display for SignedDecimal
impl Display for SignedDecimal
sourceimpl Div<SignedDecimal> for SignedDecimal
impl Div<SignedDecimal> for SignedDecimal
SignedDecimal / SignedDecimal
sourceimpl Fraction<Uint128> for SignedDecimal
impl Fraction<Uint128> for SignedDecimal
sourceimpl JsonSchema for SignedDecimal
impl JsonSchema for SignedDecimal
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn 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 more
sourceimpl Mul<SignedDecimal> for SignedDecimal
impl Mul<SignedDecimal> for SignedDecimal
type Output = SignedDecimal
type Output = SignedDecimal
The resulting type after applying the * operator.
sourceimpl Ord for SignedDecimal
impl Ord for SignedDecimal
sourcefn cmp(&self, other: &SignedDecimal) -> Ordering
fn cmp(&self, other: &SignedDecimal) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<SignedDecimal> for SignedDecimal
impl PartialEq<SignedDecimal> for SignedDecimal
sourcefn 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 ==. Read more
sourcefn ne(&self, other: &SignedDecimal) -> bool
fn ne(&self, other: &SignedDecimal) -> bool
This method tests for !=.
sourceimpl PartialOrd<SignedDecimal> for SignedDecimal
impl PartialOrd<SignedDecimal> for SignedDecimal
sourcefn partial_cmp(&self, other: &SignedDecimal) -> Option<Ordering>
fn partial_cmp(&self, other: &SignedDecimal) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl Serialize for SignedDecimal
impl Serialize for SignedDecimal
sourceimpl 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.
sourcefn sub(
self,
other: &SignedDecimal
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
fn sub(
self,
other: &SignedDecimal
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
Performs the - operation. Read more
sourceimpl 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.
sourcefn sub(
self,
other: &SignedDecimal
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
fn sub(
self,
other: &SignedDecimal
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
Performs the - operation. Read more
sourceimpl<'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.
sourcefn sub(
self,
other: SignedDecimal
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
fn sub(
self,
other: SignedDecimal
) -> <SignedDecimal as Sub<SignedDecimal>>::Output
Performs the - operation. Read more
sourceimpl Sub<SignedDecimal> for SignedDecimal
impl Sub<SignedDecimal> for SignedDecimal
type Output = SignedDecimal
type Output = SignedDecimal
The resulting type after applying the - operator.
sourceimpl SubAssign<&SignedDecimal> for SignedDecimal
impl SubAssign<&SignedDecimal> for SignedDecimal
sourcefn sub_assign(&mut self, other: &SignedDecimal)
fn sub_assign(&mut self, other: &SignedDecimal)
Performs the -= operation. Read more
sourceimpl SubAssign<SignedDecimal> for SignedDecimal
impl SubAssign<SignedDecimal> for SignedDecimal
sourcefn sub_assign(&mut self, rhs: SignedDecimal)
fn sub_assign(&mut self, rhs: SignedDecimal)
Performs the -= operation. Read more
impl Copy for SignedDecimal
impl Eq for SignedDecimal
impl StructuralEq for SignedDecimal
impl StructuralPartialEq for SignedDecimal
Auto Trait Implementations
impl RefUnwindSafe for SignedDecimal
impl Send for SignedDecimal
impl Sync for SignedDecimal
impl Unpin for SignedDecimal
impl UnwindSafe for SignedDecimal
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more