pub struct Amount(/* private fields */);
Implementations§
Source§impl Amount
impl Amount
pub const ZERO: Amount
pub fn from_strict_val_unchecked(value: &StrictVal) -> Amount
pub fn with_precision(amount: u64, precision: impl Into<Precision>) -> Amount
pub fn with_precision_checked( amount: u64, precision: impl Into<Precision>, ) -> Option<Amount>
pub fn value(self) -> u64
pub fn split(self, precision: impl Into<Precision>) -> (u64, u64)
pub fn round(&self, precision: impl Into<Precision>) -> u64
pub fn ceil(&self, precision: impl Into<Precision>) -> u64
pub fn floor(&self, precision: impl Into<Precision>) -> u64
pub fn rem(&self, precision: impl Into<Precision>) -> u64
pub fn saturating_add(&self, other: impl Into<Amount>) -> Amount
pub fn saturating_sub(&self, other: impl Into<Amount>) -> Amount
pub fn saturating_add_assign(&mut self, other: impl Into<Amount>)
pub fn saturating_sub_assign(&mut self, other: impl Into<Amount>)
pub fn checked_add(&self, other: impl Into<Amount>) -> Option<Amount>
pub fn checked_sub(&self, other: impl Into<Amount>) -> Option<Amount>
pub fn checked_add_assign(&mut self, other: impl Into<Amount>) -> Option<()>
pub fn checked_sub_assign(&mut self, other: impl Into<Amount>) -> Option<()>
Trait Implementations§
Source§impl AddAssign for Amount
impl AddAssign for Amount
Source§fn add_assign(&mut self, rhs: Amount)
fn add_assign(&mut self, rhs: Amount)
Performs the
+=
operation. Read moreSource§impl<'de> Deserialize<'de> for Amount
impl<'de> Deserialize<'de> for Amount
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Amount, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Amount, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DivAssign for Amount
impl DivAssign for Amount
Source§fn div_assign(&mut self, rhs: Amount)
fn div_assign(&mut self, rhs: Amount)
Performs the
/=
operation. Read moreSource§impl From<Amount> for AllocatedState
impl From<Amount> for AllocatedState
Source§impl From<Amount> for FungibleState
impl From<Amount> for FungibleState
Source§fn from(amount: Amount) -> FungibleState
fn from(amount: Amount) -> FungibleState
Converts to this type from the input type.
Source§impl From<Amount> for RevealedValue
impl From<Amount> for RevealedValue
Source§fn from(amount: Amount) -> RevealedValue
fn from(amount: Amount) -> RevealedValue
Converts to this type from the input type.
Source§impl From<FungibleState> for Amount
impl From<FungibleState> for Amount
Source§fn from(state: FungibleState) -> Amount
fn from(state: FungibleState) -> Amount
Converts to this type from the input type.
Source§impl From<RevealedValue> for Amount
impl From<RevealedValue> for Amount
Source§fn from(value: RevealedValue) -> Amount
fn from(value: RevealedValue) -> Amount
Converts to this type from the input type.
Source§impl KnownState for Amount
impl KnownState for Amount
const IS_FUNGIBLE: bool = true
Source§impl MulAssign for Amount
impl MulAssign for Amount
Source§fn mul_assign(&mut self, rhs: Amount)
fn mul_assign(&mut self, rhs: Amount)
Performs the
*=
operation. Read moreSource§impl Ord for Amount
impl Ord for Amount
Source§impl PartialOrd for Amount
impl PartialOrd for Amount
Source§impl RemAssign for Amount
impl RemAssign for Amount
Source§fn rem_assign(&mut self, rhs: Amount)
fn rem_assign(&mut self, rhs: Amount)
Performs the
%=
operation. Read moreSource§impl Serialize for Amount
impl Serialize for Amount
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl StrictDecode for Amount
impl StrictDecode for Amount
fn strict_decode(reader: &mut impl TypedRead) -> Result<Amount, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDeserialize for Amount
impl StrictDeserialize for Amount
fn from_strict_serialized<const MAX: usize>( ast_data: Confined<Vec<u8>, 0, MAX>, ) -> Result<Self, DeserializeError>
fn strict_deserialize_from_file<const MAX: usize>( path: impl AsRef<Path>, ) -> Result<Self, DeserializeError>
Source§impl StrictEncode for Amount
impl StrictEncode for Amount
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictSerialize for Amount
impl StrictSerialize for Amount
fn strict_serialized_len<const MAX: usize>(&self) -> Result<usize, Error>
fn to_strict_serialized<const MAX: usize>( &self, ) -> Result<Confined<Vec<u8>, 0, MAX>, SerializeError>
fn strict_serialize_to_file<const MAX: usize>( &self, path: impl AsRef<Path>, ) -> Result<(), SerializeError>
Source§impl StrictTuple for Amount
impl StrictTuple for Amount
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for Amount
impl StrictType for Amount
const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB_CONTRACT
fn strict_name() -> Option<TypeName>
Source§impl SubAssign for Amount
impl SubAssign for Amount
Source§fn sub_assign(&mut self, rhs: Amount)
fn sub_assign(&mut self, rhs: Amount)
Performs the
-=
operation. Read moreSource§impl Wrapper for Amount
impl Wrapper for Amount
Source§fn from_inner(inner: <Amount as Wrapper>::Inner) -> Amount
fn from_inner(inner: <Amount as Wrapper>::Inner) -> Amount
Instantiates wrapper type with the inner data
Source§fn as_inner(&self) -> &<Amount as Wrapper>::Inner
fn as_inner(&self) -> &<Amount as Wrapper>::Inner
Returns reference to the inner representation for the wrapper type
Source§fn into_inner(self) -> <Amount as Wrapper>::Inner
fn into_inner(self) -> <Amount as Wrapper>::Inner
Unwraps the wrapper returning the inner type
Source§impl WrapperMut for Amount
impl WrapperMut for Amount
impl Copy for Amount
impl Eq for Amount
impl StrictProduct for Amount
impl StructuralPartialEq for Amount
Auto Trait Implementations§
impl Freeze for Amount
impl RefUnwindSafe for Amount
impl Send for Amount
impl Sync for Amount
impl Unpin for Amount
impl UnwindSafe for Amount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.