Struct concordium_std::Amount [−][src]
#[repr(transparent)]pub struct Amount { pub micro_gtu: u64, }
Expand description
The type of amounts on the chain
Fields
micro_gtu: u64Implementations
impl Amount[src]
impl Amount[src]pub fn from_micro_gtu(micro_gtu: u64) -> Amount[src]
pub fn from_micro_gtu(micro_gtu: u64) -> Amount[src]Create amount from a number of microGTU
pub fn add_micro_gtu(self, micro_gtu: u64) -> Amount[src]
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]
pub fn checked_add(self, other: Amount) -> Option<Amount>[src]Checked addition. Adds another amount and return None if overflow occurred
pub fn subtract_micro_gtu(self, micro_gtu: u64) -> Amount[src]
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]
pub fn subtract_gtu(self, gtu: u64) -> Amount[src]Subtract a number of GTU to an amount
Trait Implementations
impl AddAssign<Amount> for Amount[src]
impl AddAssign<Amount> for Amount[src]pub fn add_assign(&mut self, other: Amount)[src]
pub fn add_assign(&mut self, other: Amount)[src]Performs the += operation. Read more
impl FromStr 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
nstarts with 0 then it must be 0l mcan have at most 6 digits, and must have at least 1- both
nandmmust be non-negative.
impl MulAssign<u64> for Amount[src]
impl MulAssign<u64> for Amount[src]pub fn mul_assign(&mut self, other: u64)[src]
pub fn mul_assign(&mut self, other: u64)[src]Performs the *= operation. Read more
impl Ord for Amount[src]
impl Ord for Amount[src]impl PartialOrd<Amount> for Amount[src]
impl PartialOrd<Amount> for Amount[src]pub fn partial_cmp(&self, other: &Amount) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Amount) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl RemAssign<u64> for Amount[src]
impl RemAssign<u64> for Amount[src]pub fn rem_assign(&mut self, other: u64)[src]
pub fn rem_assign(&mut self, other: u64)[src]Performs the %= operation. Read more
impl SubAssign<Amount> for Amount[src]
impl SubAssign<Amount> for Amount[src]pub fn sub_assign(&mut self, other: Amount)[src]
pub fn sub_assign(&mut self, other: Amount)[src]Performs the -= operation. Read more
impl Copy for Amount[src]
impl Eq for Amount[src]
impl StructuralEq for Amount[src]
impl StructuralPartialEq for Amount[src]
Auto Trait Implementations
impl RefUnwindSafe for Amount
impl Send for Amount
impl Sync for Amount
impl Unpin for Amount
impl UnwindSafe for Amount
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<A> Serialize for A where
A: Deserial + Serial, [src]
A: Deserial + Serial,