[−][src]Struct zebra_chain::amount::Amount
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]
C2: Constraint,
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]
C: Constraint,
type Output = Result<Amount<C>, Error>
The resulting type after applying the +
operator.
pub fn add(self, rhs: Amount<C>) -> Self::Output
[src]
impl<C> Add<Result<Amount<C>, Error>> for Amount<C> where
C: Constraint,
[src]
C: Constraint,
type Output = Result<Amount<C>, Error>
The resulting type after applying the +
operator.
pub fn add(self, rhs: Result<Amount<C>, Error>) -> Self::Output
[src]
impl<C> Arbitrary for Amount<C> where
C: Constraint + Debug,
[src]
C: Constraint + Debug,
type Parameters = ()
The type of parameters that arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
. Read more
pub fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
[src]
type Strategy = BoxedStrategy<Self>
pub fn arbitrary() -> Self::Strategy
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]
C: Constraint,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Div<u64> for Amount<NonNegative>
[src]
type Output = Result<Amount<NonNegative>, Error>
The resulting type after applying the /
operator.
pub fn div(self, rhs: u64) -> Self::Output
[src]
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
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Mul<u64> for Amount<NonNegative>
[src]
type Output = Result<Amount<NonNegative>, Error>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: u64) -> Self::Output
[src]
impl Ord for Amount<NegativeAllowed>
[src]
pub fn cmp(&self, other: &Amount<NegativeAllowed>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl Ord for Amount<NonNegative>
[src]
pub fn cmp(&self, other: &Amount<NonNegative>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<C1, C2> PartialEq<Amount<C2>> for Amount<C1>
[src]
pub fn eq(&self, other: &Amount<C2>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<C1, C2> PartialOrd<Amount<C2>> for Amount<C1>
[src]
pub fn partial_cmp(&self, other: &Amount<C2>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<C> Serialize for Amount<C> where
C: Constraint,
[src]
C: Constraint,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<C> Sub<Amount<C>> for Amount<C> where
C: Constraint,
[src]
C: Constraint,
type Output = Result<Amount<C>, Error>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Amount<C>) -> Self::Output
[src]
impl<C> Sub<Result<Amount<C>, Error>> for Amount<C> where
C: Constraint,
[src]
C: Constraint,
type Output = Result<Amount<C>, Error>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Result<Amount<C>, Error>) -> Self::Output
[src]
impl<C> TryFrom<i32> for Amount<C> where
C: Constraint,
[src]
C: Constraint,
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: i32) -> Result<Self, Self::Error>
[src]
impl<C> TryFrom<i64> for Amount<C> where
C: Constraint,
[src]
C: Constraint,
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: i64) -> Result<Self, Self::Error>
[src]
impl<C> TryFrom<u64> for Amount<C> where
C: Constraint,
[src]
C: Constraint,
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: u64) -> Result<Self, Self::Error>
[src]
impl ZcashDeserialize for Amount<NegativeAllowed>
[src]
pub fn zcash_deserialize<R: Read>(
mut reader: R
) -> Result<Self, SerializationError>
[src]
mut reader: R
) -> Result<Self, SerializationError>
impl ZcashDeserialize for Amount<NonNegative>
[src]
pub fn zcash_deserialize<R: Read>(
mut reader: R
) -> Result<Self, SerializationError>
[src]
mut reader: R
) -> Result<Self, SerializationError>
impl ZcashSerialize for Amount<NegativeAllowed>
[src]
pub fn zcash_serialize<W: Write>(&self, mut writer: W) -> Result<(), Error>
[src]
pub fn zcash_serialize_to_vec(&self) -> Result<Vec<u8>, Error>
[src]
impl ZcashSerialize for Amount<NonNegative>
[src]
Auto Trait Implementations
impl<C> RefUnwindSafe for Amount<C> where
C: RefUnwindSafe,
[src]
C: RefUnwindSafe,
impl<C> Send for Amount<C> where
C: Send,
[src]
C: Send,
impl<C> Sync for Amount<C> where
C: Sync,
[src]
C: Sync,
impl<C> Unpin for Amount<C> where
C: Unpin,
[src]
C: Unpin,
impl<C> UnwindSafe for Amount<C> where
C: UnwindSafe,
[src]
C: UnwindSafe,
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Conv for T
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> FmtForward for T
pub fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
pub fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
pub fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
pub fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
pub fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
pub fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
pub fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
pub fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pipe for T
impl<T> PipeAsRef for T
pub fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Self: AsRef<T>,
T: 'a,
R: 'a,
pub fn pipe_as_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
impl<T> PipeBorrow for T
pub fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Self: Borrow<T>,
T: 'a,
R: 'a,
pub fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
impl<T> PipeDeref for T
pub fn pipe_deref<'a, R>(
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
pub fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
impl<T> PipeRef for T
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
R: 'a,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Tap for T
pub fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
pub fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
impl<T> TapDeref for T
pub fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
pub fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> TryConv for T
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,