[−][src]Struct stellar_base::amount::Amount
Amount in base units. For example, 2 XLM.
Implementations
impl Amount
[src]
pub fn from_stroops(stroops: &Stroops) -> Result<Amount>
[src]
Creates from amount specified in stroops.
pub fn checked_add(&self, other: &Amount) -> Option<Amount>
[src]
Checked addition. Computes self + other
, returning None if overflow occurred.
pub fn checked_sub(&self, other: &Amount) -> Option<Amount>
[src]
Checked subtraction. Computes self - other
, returning None if overflow occurred.
pub fn checked_mul(&self, other: &Amount) -> Option<Amount>
[src]
Checked multiplication. Computes self * other
, returning None if overflow occurred.
pub fn checked_div(&self, other: &Amount) -> Option<Amount>
[src]
Checked division. Computes self / other
, returning None if overflow occurred or other == 0.0
.
pub fn checked_rem(&self, other: &Amount) -> Option<Amount>
[src]
Checked division. Computes self % other
, returning None if overflow occurred or other == 0.0
.
pub fn to_stroops(&self) -> Result<Stroops>
[src]
Returns the equivalent amount in stroops.
Trait Implementations
impl Clone for Amount
[src]
impl Debug for Amount
[src]
impl Display for Amount
[src]
impl Eq for Amount
[src]
impl FromStr for Amount
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Amount>
[src]
impl Ord for Amount
[src]
fn cmp(&self, other: &Amount) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Amount> for Amount
[src]
impl PartialOrd<Amount> for Amount
[src]
fn partial_cmp(&self, other: &Amount) -> Option<Ordering>
[src]
fn lt(&self, other: &Amount) -> bool
[src]
fn le(&self, other: &Amount) -> bool
[src]
fn gt(&self, other: &Amount) -> bool
[src]
fn ge(&self, other: &Amount) -> bool
[src]
impl StructuralEq for Amount
[src]
impl StructuralPartialEq for Amount
[src]
impl TryFrom<Amount> for Stroops
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(amount: Amount) -> Result<Self, Self::Error>
[src]
impl TryFrom<Stroops> 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> 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,
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<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
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>,