Struct snarkvm_dpc::virtual_machine::amount::AleoAmount
source · [−]pub struct AleoAmount(pub i64);
Expand description
Represents the amount of ALEOs.
Tuple Fields
0: i64
Implementations
sourceimpl AleoAmount
impl AleoAmount
sourcepub const ONE_BYTE: AleoAmount
pub const ONE_BYTE: AleoAmount
Exactly one Aleo byte (AB).
sourcepub const ONE_CREDIT: AleoAmount
pub const ONE_CREDIT: AleoAmount
Exactly one Aleo credit (ALEO).
sourcepub const ONE_GATE: AleoAmount
pub const ONE_GATE: AleoAmount
Exactly one Aleo gate (AG).
sourcepub const ZERO: AleoAmount
pub const ZERO: AleoAmount
The zero amount.
sourcepub fn from_gates(gate_value: i64) -> Self
pub fn from_gates(gate_value: i64) -> Self
Create an AleoAmount
given a number of gates.
sourcepub fn sub(self, b: AleoAmount) -> Self
pub fn sub(self, b: AleoAmount) -> Self
Subtract the value of two AleoAmounts
sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true
the amount is positive and false
if the amount is zero or
negative.
sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true
if the amount is negative and false
if the amount is zero or
positive.
Trait Implementations
sourceimpl Clone for AleoAmount
impl Clone for AleoAmount
sourcefn clone(&self) -> AleoAmount
fn clone(&self) -> AleoAmount
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AleoAmount
impl Debug for AleoAmount
sourceimpl<'de> Deserialize<'de> for AleoAmount
impl<'de> Deserialize<'de> for AleoAmount
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for AleoAmount
impl Display for AleoAmount
sourceimpl FromBytes for AleoAmount
impl FromBytes for AleoAmount
sourceimpl Hash for AleoAmount
impl Hash for AleoAmount
sourceimpl Ord for AleoAmount
impl Ord for AleoAmount
sourceimpl PartialEq<AleoAmount> for AleoAmount
impl PartialEq<AleoAmount> for AleoAmount
sourcefn eq(&self, other: &AleoAmount) -> bool
fn eq(&self, other: &AleoAmount) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AleoAmount) -> bool
fn ne(&self, other: &AleoAmount) -> bool
This method tests for !=
.
sourceimpl PartialOrd<AleoAmount> for AleoAmount
impl PartialOrd<AleoAmount> for AleoAmount
sourcefn partial_cmp(&self, other: &AleoAmount) -> Option<Ordering>
fn partial_cmp(&self, other: &AleoAmount) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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
sourceimpl Serialize for AleoAmount
impl Serialize for AleoAmount
sourceimpl Sum<AleoAmount> for AleoAmount
impl Sum<AleoAmount> for AleoAmount
sourcefn sum<I: Iterator<Item = AleoAmount>>(iter: I) -> AleoAmount
fn sum<I: Iterator<Item = AleoAmount>>(iter: I) -> AleoAmount
Method which takes an iterator and generates Self
from the elements by
“summing up” the items. Read more
sourceimpl ToBytes for AleoAmount
impl ToBytes for AleoAmount
impl Copy for AleoAmount
impl Eq for AleoAmount
impl StructuralEq for AleoAmount
impl StructuralPartialEq for AleoAmount
Auto Trait Implementations
impl RefUnwindSafe for AleoAmount
impl Send for AleoAmount
impl Sync for AleoAmount
impl Unpin for AleoAmount
impl UnwindSafe for AleoAmount
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more