pub struct Amount(/* private fields */);Expand description
Amount in base units. For example, 2 XLM.
Implementations§
Source§impl Amount
impl Amount
Sourcepub fn from_stroops(stroops: &Stroops) -> Result<Amount>
pub fn from_stroops(stroops: &Stroops) -> Result<Amount>
Creates from amount specified in stroops.
Sourcepub fn checked_add(&self, other: &Amount) -> Option<Amount>
pub fn checked_add(&self, other: &Amount) -> Option<Amount>
Checked addition. Computes self + other, returning None if overflow occurred.
Sourcepub fn checked_sub(&self, other: &Amount) -> Option<Amount>
pub fn checked_sub(&self, other: &Amount) -> Option<Amount>
Checked subtraction. Computes self - other, returning None if overflow occurred.
Sourcepub fn checked_mul(&self, other: &Amount) -> Option<Amount>
pub fn checked_mul(&self, other: &Amount) -> Option<Amount>
Checked multiplication. Computes self * other, returning None if overflow occurred.
Sourcepub fn checked_div(&self, other: &Amount) -> Option<Amount>
pub fn checked_div(&self, other: &Amount) -> Option<Amount>
Checked division. Computes self / other, returning None if overflow occurred or other == 0.0.
Sourcepub fn checked_rem(&self, other: &Amount) -> Option<Amount>
pub fn checked_rem(&self, other: &Amount) -> Option<Amount>
Checked division. Computes self % other, returning None if overflow occurred or other == 0.0.
Sourcepub fn to_stroops(&self) -> Result<Stroops>
pub fn to_stroops(&self) -> Result<Stroops>
Returns the equivalent amount in stroops.
Trait Implementations§
Source§impl Ord for Amount
impl Ord for Amount
Source§impl PartialOrd for Amount
impl PartialOrd for Amount
impl Eq for Amount
impl StructuralPartialEq for Amount
Auto Trait Implementations§
impl Freeze for Amount
impl RefUnwindSafe for Amount
impl Send for Amount
impl Sync for Amount
impl Unpin for Amount
impl UnwindSafe for Amount
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