pub struct Amount(/* private fields */);
Implementations§
Source§impl Amount
impl Amount
pub const ZERO: Self
pub fn from_strict_val_unchecked(value: &StrictVal) -> Self
pub fn with_precision(amount: u64, precision: impl Into<Precision>) -> Self
pub fn with_precision_checked( amount: u64, precision: impl Into<Precision>, ) -> Option<Self>
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<Self>) -> Self
pub fn saturating_sub(&self, other: impl Into<Self>) -> Self
pub fn saturating_add_assign(&mut self, other: impl Into<Self>)
pub fn saturating_sub_assign(&mut self, other: impl Into<Self>)
pub fn checked_add(&self, other: impl Into<Self>) -> Option<Self>
pub fn checked_sub(&self, other: impl Into<Self>) -> Option<Self>
pub fn checked_add_assign(&mut self, other: impl Into<Self>) -> Option<()>
pub fn checked_sub_assign(&mut self, other: impl Into<Self>) -> Option<()>
Trait Implementations§
Source§impl AddAssign for Amount
impl AddAssign for Amount
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl<'de> Deserialize<'de> for Amount
impl<'de> Deserialize<'de> for Amount
Source§fn 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
Source§impl DivAssign for Amount
impl DivAssign for Amount
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moreSource§impl MulAssign for Amount
impl MulAssign for Amount
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
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: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moreSource§impl StrictDecode for Amount
impl StrictDecode for Amount
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, 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<const MAX: usize>( read: impl Read, ) -> 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: TypedWrite>(&self, writer: W) -> Result<W>
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<const MAX: usize>( &self, write: impl Write, ) -> Result<(), Error>
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: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreSource§impl Wrapper for Amount
impl Wrapper for Amount
Source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
Source§fn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type
Source§impl WrapperMut for Amount
impl WrapperMut for Amount
Source§fn as_inner_mut(&mut self) -> &mut <Self as Wrapper>::Inner
fn as_inner_mut(&mut self) -> &mut <Self as Wrapper>::Inner
Returns a mutable reference to the inner representation for the wrapper
type
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.