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 moresourceimpl 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 moresourceimpl<'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 moresourceimpl 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 moresourceimpl 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 moresourceimpl 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 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl 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 moresourceimpl 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 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
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
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>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moresourceimpl 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 moresourceimpl 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 moresourceimpl<'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 moresourceimpl 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 moresourceimpl 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 moreimpl 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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