pub struct Mint(/* private fields */);Implementations§
Source§impl Mint
impl Mint
pub fn new() -> Self
pub fn policy_count(&self) -> usize
pub fn insert_assets( &mut self, policy_id: &PolicyId, assets: &MapAssetNameToNonZeroInt64, ) -> Option<MapAssetNameToNonZeroInt64>
pub fn get_assets(&self, key: &PolicyId) -> Option<MapAssetNameToNonZeroInt64>
Sourcepub fn get(&self, policy_id: &PolicyId, asset: &AssetName) -> Option<i64>
pub fn get(&self, policy_id: &PolicyId, asset: &AssetName) -> Option<i64>
Get the value of policy_id:asset_name if it exists.
Sourcepub fn set(
&mut self,
policy_id: &PolicyId,
asset: &AssetName,
value: i64,
) -> Option<i64>
pub fn set( &mut self, policy_id: &PolicyId, asset: &AssetName, value: i64, ) -> Option<i64>
Set the value of policy_id:asset_name to value. Returns the previous value, or None if it didn’t exist
pub fn keys(&self) -> PolicyIdList
Sourcepub fn checked_add(&self, rhs: &Mint) -> Result<Mint, JsError>
pub fn checked_add(&self, rhs: &Mint) -> Result<Mint, JsError>
Adds two mints together, checking value bounds. Does not modify self, and instead returns the result.
Sourcepub fn checked_sub(&self, rhs: &Mint) -> Result<Mint, JsError>
pub fn checked_sub(&self, rhs: &Mint) -> Result<Mint, JsError>
Subtracts rhs from this mint. This does not modify self, and instead returns the result.
Sourcepub fn as_positive_multiasset(&self) -> MultiAsset
pub fn as_positive_multiasset(&self) -> MultiAsset
Returns the multiasset where only positive (minting) entries are present
Sourcepub fn as_negative_multiasset(&self) -> MultiAsset
pub fn as_negative_multiasset(&self) -> MultiAsset
Returns the multiasset where only negative (burning) entries are present
Trait Implementations§
Source§impl FromWasmAbi for Mint
impl FromWasmAbi for Mint
Source§impl IntoWasmAbi for Mint
impl IntoWasmAbi for Mint
Source§impl LongRefFromWasmAbi for Mint
impl LongRefFromWasmAbi for Mint
Source§impl OptionFromWasmAbi for Mint
impl OptionFromWasmAbi for Mint
Source§impl OptionIntoWasmAbi for Mint
impl OptionIntoWasmAbi for Mint
Source§impl RefFromWasmAbi for Mint
impl RefFromWasmAbi for Mint
Source§impl RefMutFromWasmAbi for Mint
impl RefMutFromWasmAbi for Mint
Source§impl TryFromJsValue for Mint
impl TryFromJsValue for Mint
Source§impl VectorFromWasmAbi for Mint
impl VectorFromWasmAbi for Mint
Source§impl VectorIntoWasmAbi for Mint
impl VectorIntoWasmAbi for Mint
impl SupportsConstructor for Mint
impl SupportsInstanceProperty for Mint
impl SupportsStaticProperty for Mint
Auto Trait Implementations§
impl Freeze for Mint
impl RefUnwindSafe for Mint
impl Send for Mint
impl Sync for Mint
impl Unpin for Mint
impl UnwindSafe for Mint
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.