pub trait AssetsCallback<AssetId, AccountId, Balance> {
// Provided methods
fn created(_id: &AssetId, _owner: &AccountId) -> Result<(), ()> { ... }
fn destroyed(_id: &AssetId) -> Result<(), ()> { ... }
fn issued(_id: &AssetId, _owner: &AccountId, _amount: Balance) { ... }
fn transferred(
_id: &AssetId,
_from: &AccountId,
_to: &AccountId,
_amount: Balance,
) { ... }
fn burned(_id: &AssetId, _owner: &AccountId, _amount: Balance) { ... }
fn deposited(_id: &AssetId, _who: &AccountId, _amount: Balance) { ... }
fn withdrawn(_id: &AssetId, _who: &AccountId, _amount: Balance) { ... }
}Expand description
Callbacks executed on asset lifecycle and balance-change events.
Provided Methods§
Sourcefn created(_id: &AssetId, _owner: &AccountId) -> Result<(), ()>
fn created(_id: &AssetId, _owner: &AccountId) -> Result<(), ()>
Indicates that asset with id was successfully created by the owner
Sourcefn destroyed(_id: &AssetId) -> Result<(), ()>
fn destroyed(_id: &AssetId) -> Result<(), ()>
Indicates that asset with id has just been destroyed
Sourcefn issued(_id: &AssetId, _owner: &AccountId, _amount: Balance)
fn issued(_id: &AssetId, _owner: &AccountId, _amount: Balance)
Indicates that amount of asset id was minted into owner, increasing total supply.
Sourcefn transferred(
_id: &AssetId,
_from: &AccountId,
_to: &AccountId,
_amount: Balance,
)
fn transferred( _id: &AssetId, _from: &AccountId, _to: &AccountId, _amount: Balance, )
Indicates that amount of asset id was moved from from to to.
Sourcefn burned(_id: &AssetId, _owner: &AccountId, _amount: Balance)
fn burned(_id: &AssetId, _owner: &AccountId, _amount: Balance)
Indicates that amount of asset id was burned from owner, decreasing total supply.
Sourcefn deposited(_id: &AssetId, _who: &AccountId, _amount: Balance)
fn deposited(_id: &AssetId, _who: &AccountId, _amount: Balance)
Indicates that amount of asset id was credited to who without changing total supply.
Sourcefn withdrawn(_id: &AssetId, _who: &AccountId, _amount: Balance)
fn withdrawn(_id: &AssetId, _who: &AccountId, _amount: Balance)
Indicates that amount of asset id was debited from who without changing total supply.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.