Struct oasis_contract_sdk_types::token::BaseUnits
source · pub struct BaseUnits(pub u128, pub Denomination);
Expand description
Token amount of given denomination in base units.
Tuple Fields§
§0: u128
§1: Denomination
Implementations§
source§impl BaseUnits
impl BaseUnits
sourcepub fn new(amount: u128, denomination: Denomination) -> Self
pub fn new(amount: u128, denomination: Denomination) -> Self
Creates a new token amount of the given denomination.
sourcepub fn denomination(&self) -> &Denomination
pub fn denomination(&self) -> &Denomination
Denomination of the token amount.
Trait Implementations§
source§impl Decode for BaseUnits
impl Decode for BaseUnits
source§fn try_default() -> Result<Self, DecodeError>
fn try_default() -> Result<Self, DecodeError>
Try to decode from a missing/null/undefined value.
source§fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
Try to decode from a given CBOR value.
§fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a given CBOR value, calling
try_default
in case the value is null or
undefined.source§impl Ord for BaseUnits
impl Ord for BaseUnits
source§impl PartialEq for BaseUnits
impl PartialEq for BaseUnits
source§impl PartialOrd for BaseUnits
impl PartialOrd for BaseUnits
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 moreimpl Eq for BaseUnits
impl StructuralPartialEq for BaseUnits
Auto Trait Implementations§
impl Freeze for BaseUnits
impl RefUnwindSafe for BaseUnits
impl Send for BaseUnits
impl Sync for BaseUnits
impl Unpin for BaseUnits
impl UnwindSafe for BaseUnits
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.