[][src]Struct safe_nd::Coins

pub struct Coins(_);

Structure representing a safecoin amount.

Methods

impl Coins[src]

pub fn from_nano(value: u64) -> Result<Self>[src]

New value from a number of nano coin.

pub fn max_value() -> Self[src]

The maximum value a Coins can represent.

pub fn as_nano(self) -> u64[src]

Total coin expressed in number of nano coin.

pub fn checked_add(self, rhs: Coins) -> Option<Coins>[src]

Computes self + rhs, returning None if overflow occurred.

pub fn checked_sub(self, rhs: Coins) -> Option<Coins>[src]

Computes self - rhs, returning None if overflow occurred.

Trait Implementations

impl Clone for Coins[src]

impl Copy for Coins[src]

impl Debug for Coins[src]

impl<'de> Deserialize<'de> for Coins[src]

impl Display for Coins[src]

impl Eq for Coins[src]

impl FromStr for Coins[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for Coins[src]

impl Ord for Coins[src]

impl PartialEq<Coins> for Coins[src]

impl PartialOrd<Coins> for Coins[src]

impl Serialize for Coins[src]

impl StructuralEq for Coins[src]

impl StructuralPartialEq for Coins[src]

impl TryFrom<Response> for Coins[src]

type Error = TryFromError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Coins

impl Send for Coins

impl Sync for Coins

impl Unpin for Coins

impl UnwindSafe for Coins

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.