[][src]Struct stellar_base::amount::Stroops

pub struct Stroops(_);

Amount in stroops. This is the smallest amount unit.

Implementations

impl Stroops[src]

pub fn new(amount: i64) -> Stroops[src]

Creates with stroops amount.

pub fn max() -> Stroops[src]

Creates with maximum amount of stroops.

pub fn to_i64(&self) -> i64[src]

Returns the stroops amount as i64.

pub fn checked_add(&self, other: &Stroops) -> Option<Stroops>[src]

Checked addition. Computes self + other, returning None if overflow occurred.

pub fn checked_sub(&self, other: &Stroops) -> Option<Stroops>[src]

Checked subtraction. Computes self - other, returning None if overflow occurred.

pub fn checked_mul(&self, other: &Stroops) -> Option<Stroops>[src]

Checked multiplication. Computes self * other, returning None if overflow occurred.

pub fn checked_div(&self, other: &Stroops) -> Option<Stroops>[src]

Checked division. Computes self / other, returning None if overflow occurred or other == 0.0.

pub fn checked_rem(&self, other: &Stroops) -> Option<Stroops>[src]

Checked division. Computes self % other, returning None if overflow occurred or other == 0.0.

pub fn to_xdr_int64(&self) -> Result<Int64>[src]

Returns stroops amount as xdr object.

pub fn to_xdr_uint32(&self) -> Result<Uint32>[src]

Returns stroops amount as xdr object.

pub fn from_xdr_int64(x: &Int64) -> Result<Stroops>[src]

Creates from xdr object.

pub fn from_xdr_uint32(x: &Uint32) -> Result<Stroops>[src]

Creates from xdr object.

Trait Implementations

impl Clone for Stroops[src]

impl Copy for Stroops[src]

impl Debug for Stroops[src]

impl Eq for Stroops[src]

impl Ord for Stroops[src]

impl PartialEq<Stroops> for Stroops[src]

impl PartialOrd<Stroops> for Stroops[src]

impl StructuralEq for Stroops[src]

impl StructuralPartialEq for Stroops[src]

impl TryFrom<Amount> for Stroops[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Stroops> for Amount[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Stroops

impl Send for Stroops

impl Sync for Stroops

impl Unpin for Stroops

impl UnwindSafe for Stroops

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.