[][src]Struct zebra_chain::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: Constraint
[src]

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

pub fn to_bytes(&self) -> [u8; 8][src]

To little endian byte array

Trait Implementations

impl<C> Add<Amount<C>> for Amount<C> where
    C: Constraint
[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: Constraint
[src]

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

The resulting type after applying the + operator.

impl<C> Arbitrary for Amount<C> where
    C: Constraint + Debug
[src]

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default. Read more

type Strategy = BoxedStrategy<Self>

The type of Strategy used to generate values of type Self. Read more

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

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

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

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

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

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

The resulting type after applying the / operator.

impl Eq for Amount<NegativeAllowed>[src]

impl Eq for Amount<NonNegative>[src]

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

pub fn hash<H: Hasher>(&self, state: &mut H)[src]

Amounts with the same value are equal, even if they have different constraints

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

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

The resulting type after applying the * operator.

impl Ord for Amount<NegativeAllowed>[src]

impl Ord for Amount<NonNegative>[src]

impl<C1, C2> PartialEq<Amount<C2>> for Amount<C1>[src]

impl<C1, C2> PartialOrd<Amount<C2>> for Amount<C1>[src]

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

impl<C> Sub<Amount<C>> for Amount<C> where
    C: Constraint
[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: Constraint
[src]

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

The resulting type after applying the - operator.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

impl ZcashDeserialize for Amount<NegativeAllowed>[src]

impl ZcashDeserialize for Amount<NonNegative>[src]

impl ZcashSerialize for Amount<NegativeAllowed>[src]

impl ZcashSerialize for Amount<NonNegative>[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for Amount<C> where
    C: RefUnwindSafe
[src]

impl<C> Send for Amount<C> where
    C: Send
[src]

impl<C> Sync for Amount<C> where
    C: Sync
[src]

impl<C> Unpin for Amount<C> where
    C: Unpin
[src]

impl<C> UnwindSafe for Amount<C> where
    C: UnwindSafe
[src]

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> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

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

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

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>,