[][src]Struct zebra_chain::types::amount::Amount

pub struct Amount<C = NegativeAllowed>(_, _);

A runtime validated type for representing amounts of zatoshis

Implementations

impl<C> Amount<C>[src]

pub fn constrain<C2>(self) -> Result<Amount<C2>, Error> where
    C2: AmountConstraint
[src]

Convert this amount to a different Amount type if it satisfies the new constraint

Trait Implementations

impl<C> Add<Amount<C>> for Amount<C> where
    C: AmountConstraint
[src]

type Output = Result<Amount<C>, Error>

The resulting type after applying the + operator.

impl<C> Add<Amount<C>> for Result<Amount<C>, Error> where
    C: AmountConstraint
[src]

type Output = Result<Amount<C>, Error>

The resulting type after applying the + operator.

impl<C> Add<Result<Amount<C>, Error>> for Amount<C> where
    C: AmountConstraint
[src]

type Output = Result<Amount<C>, Error>

The resulting type after applying the + operator.

impl<C> AddAssign<Amount<C>> for Result<Amount<C>, Error> where
    Amount<C>: Copy,
    C: AmountConstraint
[src]

impl<C: Clone> Clone for Amount<C>[src]

impl<C: Copy> Copy for Amount<C>[src]

impl<C: Debug> Debug for Amount<C>[src]

impl<'de, C> Deserialize<'de> for Amount<C> where
    C: AmountConstraint
[src]

impl<C: Eq> Eq for Amount<C>[src]

impl<C> From<Amount<C>> for i64[src]

impl From<Amount<NonNegative>> for u64[src]

impl<C: PartialEq> PartialEq<Amount<C>> for Amount<C>[src]

impl<C> Serialize for Amount<C> where
    C: AmountConstraint
[src]

impl<C> StructuralEq for Amount<C>[src]

impl<C> StructuralPartialEq for Amount<C>[src]

impl<C> Sub<Amount<C>> for Amount<C> where
    C: AmountConstraint
[src]

type Output = Result<Amount<C>, Error>

The resulting type after applying the - operator.

impl<C> Sub<Amount<C>> for Result<Amount<C>, Error> where
    C: AmountConstraint
[src]

type Output = Result<Amount<C>, Error>

The resulting type after applying the - operator.

impl<C> Sub<Result<Amount<C>, Error>> for Amount<C> where
    C: AmountConstraint
[src]

type Output = Result<Amount<C>, Error>

The resulting type after applying the - operator.

impl<C> SubAssign<Amount<C>> for Result<Amount<C>, Error> where
    Amount<C>: Copy,
    C: AmountConstraint
[src]

impl<C> TryFrom<i32> for Amount<C> where
    C: AmountConstraint
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<i64> for Amount<C> where
    C: AmountConstraint
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<u64> for Amount<C> where
    C: AmountConstraint
[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<C> RefUnwindSafe for Amount<C> where
    C: RefUnwindSafe

impl<C> Send for Amount<C> where
    C: Send

impl<C> Sync for Amount<C> where
    C: Sync

impl<C> Unpin for Amount<C> where
    C: Unpin

impl<C> UnwindSafe for Amount<C> where
    C: UnwindSafe

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: for<'de> 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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,