Struct chain_impl_mockchain::value::Value
source · pub struct Value(pub u64);
Expand description
Unspent transaction value.
Tuple Fields§
§0: u64
Implementations§
source§impl Value
impl Value
pub fn zero() -> Self
pub fn sum<I>(values: I) -> Result<Self, ValueError>where I: Iterator<Item = Self>,
pub fn saturating_add(self, other: Self) -> Self
pub fn checked_add(self, other: Self) -> Result<Self, ValueError>
pub fn checked_sub(self, other: Value) -> Result<Value, ValueError>
pub fn scale(self, n: u32) -> Result<Value, ValueError>
sourcepub fn split_in(self, n: u32) -> SplitValueIn
pub fn split_in(self, n: u32) -> SplitValueIn
Divide a value by n equals parts, with a potential remainder
pub fn bytes(self) -> [u8; 8]
Trait Implementations§
source§impl Arbitrary for Value
impl Arbitrary for Value
§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
source§impl ConfigParamVariant for Value
impl ConfigParamVariant for Value
source§impl Deserialize for Value
impl Deserialize for Value
fn deserialize<R: Read>(codec: &mut Codec<R>) -> Result<Self, ReadError>
fn deserialize_validate<R>(codec: &mut Codec<R>) -> Result<(), ReadError>where R: Read,
source§impl From<AverageValue> for Value
impl From<AverageValue> for Value
source§fn from(value: AverageValue) -> Self
fn from(value: AverageValue) -> Self
Converts to this type from the input type.
source§impl From<NonZeroValue> for Value
impl From<NonZeroValue> for Value
source§fn from(value: NonZeroValue) -> Self
fn from(value: NonZeroValue) -> Self
Converts to this type from the input type.
source§impl Ord for Value
impl Ord for Value
source§impl PartialEq<Value> for Value
impl PartialEq<Value> for Value
source§impl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Value
impl Serialize for Value
source§impl TryFrom<&[u8]> for Value
impl TryFrom<&[u8]> for Value
§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
impl Copy for Value
impl Eq for Value
impl StructuralEq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more