[−][src]Struct concordium_std::Amount
The type of amounts on the chain
Fields
micro_gtu: u64
Implementations
impl Amount
[src]
pub fn from_micro_gtu(micro_gtu: u64) -> Amount
[src]
Create amount from a number of microGTU
pub fn from_gtu(gtu: u64) -> Amount
[src]
Create amount from a number of GTU
pub fn zero() -> Amount
[src]
Create zero amount
pub fn add_micro_gtu(self, micro_gtu: u64) -> Amount
[src]
Add a number of micro GTU to an amount
pub fn checked_add(self, other: Amount) -> Option<Amount>
[src]
Checked addition. Adds another amount and return None if overflow occurred
pub fn add_gtu(self, gtu: u64) -> Amount
[src]
Add a number of GTU to an amount
pub fn subtract_micro_gtu(self, micro_gtu: u64) -> Amount
[src]
Subtract a number of micro GTU to an amount
pub fn subtract_gtu(self, gtu: u64) -> Amount
[src]
Subtract a number of GTU to an amount
pub fn quotient_remainder(self, denominator: u64) -> (Amount, Amount)
[src]
Calculates the quotient and remainder of integer division
Trait Implementations
impl Add<Amount> for Amount
[src]
type Output = Amount
The resulting type after applying the +
operator.
pub fn add(self, other: Amount) -> <Amount as Add<Amount>>::Output
[src]
impl AddAssign<Amount> for Amount
[src]
pub fn add_assign(&mut self, other: Amount)
[src]
impl Clone for Amount
[src]
impl Copy for Amount
[src]
impl Debug for Amount
[src]
impl Deserial for Amount
[src]
impl Eq for Amount
[src]
impl FromStr for Amount
[src]
Parse from string in GTU units. The input string must be of the form
n[.m]
where n
and m
are both digits. The notation [.m]
indicates
that that part is optional.
- if
n
starts with 0 then it must be 0l m
can have at most 6 digits, and must have at least 1- both
n
andm
must be non-negative.
type Err = AmountParseError
The associated error which can be returned from parsing.
pub fn from_str(v: &str) -> Result<Amount, <Amount as FromStr>::Err>
[src]
impl Mul<u64> for Amount
[src]
type Output = Amount
The resulting type after applying the *
operator.
pub fn mul(self, other: u64) -> <Amount as Mul<u64>>::Output
[src]
impl MulAssign<u64> for Amount
[src]
pub fn mul_assign(&mut self, other: u64)
[src]
impl Ord for Amount
[src]
pub fn cmp(&self, other: &Amount) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Amount> for Amount
[src]
impl PartialOrd<Amount> for Amount
[src]
pub fn partial_cmp(&self, other: &Amount) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Amount) -> bool
[src]
pub fn le(&self, other: &Amount) -> bool
[src]
pub fn gt(&self, other: &Amount) -> bool
[src]
pub fn ge(&self, other: &Amount) -> bool
[src]
impl Rem<u64> for Amount
[src]
type Output = Amount
The resulting type after applying the %
operator.
pub fn rem(self, other: u64) -> <Amount as Rem<u64>>::Output
[src]
impl RemAssign<u64> for Amount
[src]
pub fn rem_assign(&mut self, other: u64)
[src]
impl SchemaType for Amount
[src]
impl Serial for Amount
[src]
impl StructuralEq for Amount
[src]
impl StructuralPartialEq for Amount
[src]
impl Sub<Amount> for Amount
[src]
type Output = Amount
The resulting type after applying the -
operator.
pub fn sub(self, other: Amount) -> <Amount as Sub<Amount>>::Output
[src]
impl SubAssign<Amount> for Amount
[src]
pub fn sub_assign(&mut self, other: Amount)
[src]
impl Sum<Amount> for Amount
[src]
Auto Trait Implementations
impl RefUnwindSafe for Amount
[src]
impl Send for Amount
[src]
impl Sync for Amount
[src]
impl Unpin for Amount
[src]
impl UnwindSafe for Amount
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<A> Serialize for A where
A: Serial + Deserial,
[src]
A: Serial + Deserial,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,