Struct wallet_core::Value
pub struct Value(pub u64);
Expand description
Unspent transaction value.
Tuple Fields§
§0: u64
Implementations§
§impl Value
impl Value
pub fn zero() -> Value
pub fn sum<I>(values: I) -> Result<Value, ValueError>where I: Iterator<Item = Value>,
pub fn saturating_add(self, other: Value) -> Value
pub fn checked_add(self, other: Value) -> Result<Value, ValueError>
pub fn checked_sub(self, other: Value) -> Result<Value, ValueError>
pub fn scale(self, n: u32) -> Result<Value, ValueError>
pub 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§
§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
.§fn arbitrary_with(
args: <Value as Arbitrary>::Parameters
) -> <Value as Arbitrary>::Strategy
fn arbitrary_with( args: <Value as Arbitrary>::Parameters ) -> <Value as Arbitrary>::Strategy
§impl Deserialize for Value
impl Deserialize for Value
fn deserialize<R>(codec: &mut Codec<R>) -> Result<Value, ReadError>where R: Read,
fn deserialize_validate<R>(codec: &mut Codec<R>) -> Result<(), ReadError>where R: Read,
§impl Ord for Value
impl Ord for Value
§impl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
§fn partial_cmp(&self, other: &Value) -> Option<Ordering>
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
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 more§impl Serialize for Value
impl Serialize for Value
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
§impl<T> DeserializeFromSlice for Twhere
T: Deserialize,
impl<T> DeserializeFromSlice for Twhere T: Deserialize,
fn deserialize_from_slice(codec: &mut Codec<&[u8]>) -> Result<T, ReadError>
fn deserialize_validate_from_slice( codec: &mut Codec<&[u8]> ) -> Result<(), ReadError>
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more