Struct monetary::AmountU128
source · pub struct AmountU128<T>(/* private fields */);Implementations§
source§impl<T> AmountU128<T>
impl<T> AmountU128<T>
pub const fn new(amount: Uint128) -> Self
pub const fn u128(&self) -> u128
pub const fn uint128(&self) -> Uint128
pub const fn zero() -> Self
pub const fn is_zero(&self) -> bool
pub fn checked_add(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_sub(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_mul(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_div(self, other: Self) -> Result<Self, DivideByZeroError>
pub fn saturating_add(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_mul(self, other: Self) -> Self
pub const fn abs_diff(self, other: Self) -> Self
pub fn dec_mul_floor(self, dec: Decimal) -> Self
pub fn dec_mul_ceil(self, dec: Decimal) -> Self
pub fn dec_div_floor(self, dec: Decimal) -> Result<Self, DivideByZeroError>
pub fn dec_div_ceil(self, dec: Decimal) -> Result<Self, DivideByZeroError>
Trait Implementations§
source§impl<T> Add<AmountU128<T>> for CheckedCoin<T>
impl<T> Add<AmountU128<T>> for CheckedCoin<T>
§type Output = CheckedCoin<T>
type Output = CheckedCoin<T>
The resulting type after applying the
+ operator.source§impl<T> Add for AmountU128<T>
impl<T> Add for AmountU128<T>
source§impl<T> AddAssign for AmountU128<T>
impl<T> AddAssign for AmountU128<T>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresource§impl<T: Clone> Clone for AmountU128<T>
impl<T: Clone> Clone for AmountU128<T>
source§fn clone(&self) -> AmountU128<T>
fn clone(&self) -> AmountU128<T>
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<T: Debug> Debug for AmountU128<T>
impl<T: Debug> Debug for AmountU128<T>
source§impl<T: Default> Default for AmountU128<T>
impl<T: Default> Default for AmountU128<T>
source§impl<'de, T> Deserialize<'de> for AmountU128<T>
impl<'de, T> Deserialize<'de> for AmountU128<T>
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<T> Display for AmountU128<T>
impl<T> Display for AmountU128<T>
source§impl<T> Div for AmountU128<T>
impl<T> Div for AmountU128<T>
source§impl<T> DivAssign for AmountU128<T>
impl<T> DivAssign for AmountU128<T>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moresource§impl<A, B> Exchange<A, B> for AmountU128<A>
impl<A, B> Exchange<A, B> for AmountU128<A>
fn mul_floor(&self, rate: &Rate<B, A>) -> AmountU128<B>
fn mul_ceil(&self, rate: &Rate<B, A>) -> AmountU128<B>
fn div_floor(&self, rate: &Rate<A, B>) -> AmountU128<B>
fn div_ceil(&self, rate: &Rate<A, B>) -> AmountU128<B>
source§impl<T> From<AmountU128<T>> for String
impl<T> From<AmountU128<T>> for String
source§fn from(val: AmountU128<T>) -> Self
fn from(val: AmountU128<T>) -> Self
Converts to this type from the input type.
source§impl<T: JsonSchema> JsonSchema for AmountU128<T>
impl<T: JsonSchema> JsonSchema for AmountU128<T>
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§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(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§impl<T> Mul for AmountU128<T>
impl<T> Mul for AmountU128<T>
source§impl<T> MulAssign for AmountU128<T>
impl<T> MulAssign for AmountU128<T>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moresource§impl<T: Eq> Ord for AmountU128<T>
impl<T: Eq> Ord for AmountU128<T>
source§impl<T: PartialEq> PartialEq for AmountU128<T>
impl<T: PartialEq> PartialEq for AmountU128<T>
source§fn eq(&self, other: &AmountU128<T>) -> bool
fn eq(&self, other: &AmountU128<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<T: PartialEq> PartialOrd for AmountU128<T>
impl<T: PartialEq> PartialOrd for AmountU128<T>
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<T> Serialize for AmountU128<T>
impl<T> Serialize for AmountU128<T>
source§impl<T> Sub<AmountU128<T>> for CheckedCoin<T>
impl<T> Sub<AmountU128<T>> for CheckedCoin<T>
§type Output = CheckedCoin<T>
type Output = CheckedCoin<T>
The resulting type after applying the
- operator.source§impl<T> Sub for AmountU128<T>
impl<T> Sub for AmountU128<T>
source§impl<T> SubAssign for AmountU128<T>
impl<T> SubAssign for AmountU128<T>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl<T: Copy> Copy for AmountU128<T>
impl<T: Eq> Eq for AmountU128<T>
impl<T> StructuralPartialEq for AmountU128<T>
Auto Trait Implementations§
impl<T> Freeze for AmountU128<T>
impl<T> RefUnwindSafe for AmountU128<T>where
T: RefUnwindSafe,
impl<T> Send for AmountU128<T>where
T: Send,
impl<T> Sync for AmountU128<T>where
T: Sync,
impl<T> Unpin for AmountU128<T>where
T: Unpin,
impl<T> UnwindSafe for AmountU128<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more