pub struct Pallet<T, I = ()>(_);
Expand description

The pallet implementing the on-chain logic.

Implementations§

source§

impl<T: Config<I>, I: 'static> Pallet<T, I>

source

pub fn adjust_extra( id: T::AssetId, who: impl Borrow<T::AccountId> ) -> Option<ExtraMutator<T, I>>

Return the extra “sid-car” data for id/who, or None if the account doesn’t exist.

source

pub fn balance(id: T::AssetId, who: impl Borrow<T::AccountId>) -> T::Balance

Get the asset id balance of who, or zero if the asset-account doesn’t exist.

source

pub fn maybe_balance( id: T::AssetId, who: impl Borrow<T::AccountId> ) -> Option<T::Balance>

Get the asset id balance of who if the asset-account exists.

source

pub fn reserved_balance( id: T::AssetId, who: impl Borrow<T::AccountId> ) -> T::Balance

Get the asset id reserved balance of who, or zero if the asset-account doesn’t exist.

source

pub fn maybe_reserved_balance( id: T::AssetId, who: impl Borrow<T::AccountId> ) -> Option<T::Balance>

Get the asset id reserved balance of who if the asset-account exists.

source

pub fn total_supply(id: T::AssetId) -> T::Balance

Get the total supply of an asset id.

source

pub fn maybe_total_supply(id: T::AssetId) -> Option<T::Balance>

Get the total supply of an asset id if the asset exists.

source

pub fn total_reserved_supply(id: T::AssetId) -> T::Balance

Get the total reserved supply of an asset id.

source

pub fn maybe_total_reserved_supply(id: T::AssetId) -> Option<T::Balance>

Get the total reversed supply of an asset id if the asset exists.

source

pub fn afloat_do_mint( id: T::AssetId, beneficiary: &T::AccountId, amount: T::Balance, maybe_check_issuer: Option<T::AccountId> ) -> DispatchResult

source

pub fn afloat_do_burn( id: T::AssetId, target: &T::AccountId, amount: T::Balance, maybe_check_admin: Option<T::AccountId>, f: DebitFlags ) -> Result<T::Balance, DispatchError>

source

pub fn reserved_balance_named( id: &T::ReserveIdentifier, asset_id: &T::AssetId, who: &T::AccountId ) -> T::Balance

source

pub fn has_named_reserve( id: &T::ReserveIdentifier, asset_id: &T::AssetId, who: &T::AccountId ) -> bool

source

pub fn reserve_named( id: &T::ReserveIdentifier, asset_id: T::AssetId, who: &T::AccountId, amount: T::Balance, maybe_check_admin: Option<T::AccountId> ) -> DispatchResult

Move value from the free balance from who to a named reserve balance.

Is a no-op if value to be reserved is zero.

source

pub fn unreserve_named( id: &T::ReserveIdentifier, asset_id: T::AssetId, who: &T::AccountId, maybe_check_admin: Option<T::AccountId> ) -> DispatchResult

source

pub fn burn_named_reserve( id: &T::ReserveIdentifier, asset_id: T::AssetId, who: &T::AccountId, maybe_check_admin: Option<T::AccountId> ) -> DispatchResult

source

pub fn transfer_named_reserve( id: &T::ReserveIdentifier, asset_id: T::AssetId, from: &T::AccountId, to: &T::AccountId, maybe_check_admin: Option<T::AccountId> ) -> DispatchResult

source

pub fn does_asset_exists(asset_id: T::AssetId) -> bool

source§

impl<T: Config<I>, I: 'static> Pallet<T, I>

source

pub fn create( origin: OriginFor<T>, id: T::AssetId, admin: <<T as Config>::Lookup as StaticLookup>::Source, min_balance: T::Balance ) -> DispatchResult

Issue a new class of fungible assets from a public origin.

This new asset class has no assets initially and its owner is the origin.

The origin must conform to the configured CreateOrigin and have sufficient funds free.

Funds of sender are reserved by AssetDeposit.

Parameters:

  • id: The identifier of the new asset. This must not be currently in use to identify an existing asset.
  • admin: The admin of this class of assets. The admin is the initial address of each member of the asset class’s admin team.
  • min_balance: The minimum balance of this new asset that any single account must have. If an account’s balance is reduced below this, then it collapses to zero.

Emits Created event when successful.

Weight: O(1)

source

pub fn force_create( origin: OriginFor<T>, id: T::AssetId, owner: <<T as Config>::Lookup as StaticLookup>::Source, is_sufficient: bool, min_balance: T::Balance ) -> DispatchResult

Issue a new class of fungible assets from a privileged origin.

This new asset class has no assets initially.

The origin must conform to ForceOrigin.

Unlike create, no funds are reserved.

  • id: The identifier of the new asset. This must not be currently in use to identify an existing asset.
  • owner: The owner of this class of assets. The owner has full superuser permissions over this asset, but may later change and configure the permissions using transfer_ownership and set_team.
  • min_balance: The minimum balance of this new asset that any single account must have. If an account’s balance is reduced below this, then it collapses to zero.

Emits ForceCreated event when successful.

Weight: O(1)

source

pub fn start_destroy( origin: OriginFor<T>, id: T::AssetIdParameter ) -> DispatchResult

Destroy a class of fungible assets.

The origin must conform to ForceOrigin or must be Signed and the sender must be the owner of the asset id.

  • id: The identifier of the asset to be destroyed. This must identify an existing asset.

Emits Destroyed event when successful.

NOTE: It can be helpful to first freeze an asset before destroying it so that you can provide accurate witness information and prevent users from manipulating state in a way that can make it harder to destroy.

Weight: O(c + p + a) where:

  • c = (witness.accounts - witness.sufficients)
  • s = witness.sufficients
  • a = witness.approvals Start the process of destroying a fungible asset class.

start_destroy is the first in a series of extrinsics that should be called, to allow destruction of an asset class.

The origin must conform to ForceOrigin or must be Signed by the asset’s owner.

  • id: The identifier of the asset to be destroyed. This must identify an existing asset.

The asset class must be frozen before calling start_destroy.

source

pub fn destroy_accounts( origin: OriginFor<T>, id: T::AssetIdParameter ) -> DispatchResultWithPostInfo

Destroy all accounts associated with a given asset.

destroy_accounts should only be called after start_destroy has been called, and the asset is in a Destroying state.

Due to weight restrictions, this function may need to be called multiple times to fully destroy all accounts. It will destroy RemoveItemsLimit accounts at a time.

  • id: The identifier of the asset to be destroyed. This must identify an existing asset.

Each call emits the Event::DestroyedAccounts event.

source

pub fn destroy_approvals( origin: OriginFor<T>, id: T::AssetIdParameter ) -> DispatchResultWithPostInfo

Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit).

destroy_approvals should only be called after start_destroy has been called, and the asset is in a Destroying state.

Due to weight restrictions, this function may need to be called multiple times to fully destroy all approvals. It will destroy RemoveItemsLimit approvals at a time.

  • id: The identifier of the asset to be destroyed. This must identify an existing asset.

Each call emits the Event::DestroyedApprovals event.

source

pub fn finish_destroy( origin: OriginFor<T>, id: T::AssetIdParameter ) -> DispatchResult

Complete destroying asset and unreserve currency.

finish_destroy should only be called after start_destroy has been called, and the asset is in a Destroying state. All accounts or approvals should be destroyed before hand.

  • id: The identifier of the asset to be destroyed. This must identify an existing asset.

Each successful call emits the Event::Destroyed event.

source

pub fn mint( origin: OriginFor<T>, id: T::AssetIdParameter, beneficiary: <<T as Config>::Lookup as StaticLookup>::Source, amount: T::Balance ) -> DispatchResult

Mint assets of a particular class.

The origin must be Signed and the sender must be the Issuer of the asset id.

  • id: The identifier of the asset to have some amount minted.
  • beneficiary: The account to be credited with the minted assets.
  • amount: The amount of the asset to be minted.

Emits Issued event when successful.

Weight: O(1) Modes: Pre-existing balance of beneficiary; Account pre-existence of beneficiary.

source

pub fn burn( origin: OriginFor<T>, id: T::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source, amount: T::Balance ) -> DispatchResult

Reduce the balance of who by as much as possible up to amount assets of id.

Origin must be Signed and the sender should be the Manager of the asset id.

Bails with NoAccount if the who is already dead.

  • id: The identifier of the asset to have some amount burned.
  • who: The account to be debited from.
  • amount: The maximum amount by which who’s balance should be reduced.

Emits Burned with the actual amount burned. If this takes the balance to below the minimum for the asset, then the amount burned is increased to take it to zero.

Weight: O(1) Modes: Post-existence of who; Pre & post Zombie-status of who.

source

pub fn transfer( origin: OriginFor<T>, id: T::AssetIdParameter, target: <<T as Config>::Lookup as StaticLookup>::Source, amount: T::Balance ) -> DispatchResult

Move some assets from the sender account to another.

Origin must be Signed.

  • id: The identifier of the asset to have some amount transferred.
  • target: The account to be credited.
  • amount: The amount by which the sender’s balance of assets should be reduced and target’s balance increased. The amount actually transferred may be slightly greater in the case that the transfer would otherwise take the sender balance above zero but below the minimum balance. Must be greater than zero.

Emits Transferred with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.

Weight: O(1) Modes: Pre-existence of target; Post-existence of sender; Account pre-existence of target.

source

pub fn transfer_keep_alive( origin: OriginFor<T>, id: T::AssetIdParameter, target: <<T as Config>::Lookup as StaticLookup>::Source, amount: T::Balance ) -> DispatchResult

Move some assets from the sender account to another, keeping the sender account alive.

Origin must be Signed.

  • id: The identifier of the asset to have some amount transferred.
  • target: The account to be credited.
  • amount: The amount by which the sender’s balance of assets should be reduced and target’s balance increased. The amount actually transferred may be slightly greater in the case that the transfer would otherwise take the sender balance above zero but below the minimum balance. Must be greater than zero.

Emits Transferred with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.

Weight: O(1) Modes: Pre-existence of target; Post-existence of sender; Account pre-existence of target.

source

pub fn force_transfer( origin: OriginFor<T>, id: T::AssetIdParameter, source: <<T as Config>::Lookup as StaticLookup>::Source, dest: <<T as Config>::Lookup as StaticLookup>::Source, amount: T::Balance ) -> DispatchResult

Move some assets from one account to another.

Origin must be Signed and the sender should be the Admin of the asset id.

  • id: The identifier of the asset to have some amount transferred.
  • source: The account to be debited.
  • dest: The account to be credited.
  • amount: The amount by which the source’s balance of assets should be reduced and dest’s balance increased. The amount actually transferred may be slightly greater in the case that the transfer would otherwise take the source balance above zero but below the minimum balance. Must be greater than zero.

Emits Transferred with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.

Weight: O(1) Modes: Pre-existence of dest; Post-existence of source; Account pre-existence of dest.

source

pub fn freeze( origin: OriginFor<T>, id: T::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source ) -> DispatchResult

Disallow further unprivileged transfers from an account.

Origin must be Signed and the sender should be the Freezer of the asset id.

  • id: The identifier of the asset to be frozen.
  • who: The account to be frozen.

Emits Frozen.

Weight: O(1)

source

pub fn thaw( origin: OriginFor<T>, id: T::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source ) -> DispatchResult

Allow unprivileged transfers from an account again.

Origin must be Signed and the sender should be the Admin of the asset id.

  • id: The identifier of the asset to be frozen.
  • who: The account to be unfrozen.

Emits Thawed.

Weight: O(1)

source

pub fn freeze_asset( origin: OriginFor<T>, id: T::AssetIdParameter ) -> DispatchResult

Disallow further unprivileged transfers for the asset class.

Origin must be Signed and the sender should be the Freezer of the asset id.

  • id: The identifier of the asset to be frozen.

Emits Frozen.

Weight: O(1)

source

pub fn thaw_asset( origin: OriginFor<T>, id: T::AssetIdParameter ) -> DispatchResult

Allow unprivileged transfers for the asset again.

Origin must be Signed and the sender should be the Admin of the asset id.

  • id: The identifier of the asset to be thawed.

Emits Thawed.

Weight: O(1)

source

pub fn transfer_ownership( origin: OriginFor<T>, id: T::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source ) -> DispatchResult

Change the Owner of an asset.

Origin must be Signed and the sender should be the Owner of the asset id.

  • id: The identifier of the asset.
  • owner: The new Owner of this asset.

Emits OwnerChanged.

Weight: O(1)

source

pub fn set_team( origin: OriginFor<T>, id: T::AssetIdParameter, issuer: <<T as Config>::Lookup as StaticLookup>::Source, admin: <<T as Config>::Lookup as StaticLookup>::Source, freezer: <<T as Config>::Lookup as StaticLookup>::Source ) -> DispatchResult

Change the Issuer, Admin and Freezer of an asset.

Origin must be Signed and the sender should be the Owner of the asset id.

  • id: The identifier of the asset to be frozen.
  • issuer: The new Issuer of this asset.
  • admin: The new Admin of this asset.
  • freezer: The new Freezer of this asset.

Emits TeamChanged.

Weight: O(1)

source

pub fn set_metadata( origin: OriginFor<T>, id: T::AssetIdParameter, name: Vec<u8>, symbol: Vec<u8>, decimals: u8 ) -> DispatchResult

Set the metadata for an asset.

Origin must be Signed and the sender should be the Owner of the asset id.

Funds of sender are reserved according to the formula: MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len) taking into account any already reserved funds.

  • id: The identifier of the asset to update.
  • name: The user friendly name of this asset. Limited in length by StringLimit.
  • symbol: The exchange symbol for this asset. Limited in length by StringLimit.
  • decimals: The number of decimals this asset uses to represent one unit.

Emits MetadataSet.

Weight: O(1)

source

pub fn clear_metadata( origin: OriginFor<T>, id: T::AssetIdParameter ) -> DispatchResult

Clear the metadata for an asset.

Origin must be Signed and the sender should be the Owner of the asset id.

Any deposit is freed for the asset owner.

  • id: The identifier of the asset to clear.

Emits MetadataCleared.

Weight: O(1)

source

pub fn force_set_metadata( origin: OriginFor<T>, id: T::AssetIdParameter, name: Vec<u8>, symbol: Vec<u8>, decimals: u8, is_frozen: bool ) -> DispatchResult

Force the metadata for an asset to some value.

Origin must be ForceOrigin.

Any deposit is left alone.

  • id: The identifier of the asset to update.
  • name: The user friendly name of this asset. Limited in length by StringLimit.
  • symbol: The exchange symbol for this asset. Limited in length by StringLimit.
  • decimals: The number of decimals this asset uses to represent one unit.

Emits MetadataSet.

Weight: O(N + S) where N and S are the length of the name and symbol respectively.

source

pub fn force_clear_metadata( origin: OriginFor<T>, id: T::AssetIdParameter ) -> DispatchResult

Clear the metadata for an asset.

Origin must be ForceOrigin.

Any deposit is returned.

  • id: The identifier of the asset to clear.

Emits MetadataCleared.

Weight: O(1)

source

pub fn force_asset_status( origin: OriginFor<T>, id: T::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source, issuer: <<T as Config>::Lookup as StaticLookup>::Source, admin: <<T as Config>::Lookup as StaticLookup>::Source, freezer: <<T as Config>::Lookup as StaticLookup>::Source, min_balance: T::Balance, is_sufficient: bool, is_frozen: bool ) -> DispatchResult

Alter the attributes of a given asset.

Origin must be ForceOrigin.

  • id: The identifier of the asset.
  • owner: The new Owner of this asset.
  • issuer: The new Issuer of this asset.
  • admin: The new Admin of this asset.
  • freezer: The new Freezer of this asset.
  • min_balance: The minimum balance of this new asset that any single account must have. If an account’s balance is reduced below this, then it collapses to zero.
  • is_sufficient: Whether a non-zero balance of this asset is deposit of sufficient value to account for the state bloat associated with its balance storage. If set to true, then non-zero balances may be stored without a consumer reference (and thus an ED in the Balances pallet or whatever else is used to control user-account state growth).
  • is_frozen: Whether this asset class is frozen except for permissioned/admin instructions.

Emits AssetStatusChanged with the identity of the asset.

Weight: O(1)

source

pub fn approve_transfer( origin: OriginFor<T>, id: T::AssetIdParameter, delegate: <<T as Config>::Lookup as StaticLookup>::Source, amount: T::Balance ) -> DispatchResult

Approve an amount of asset for transfer by a delegated third-party account.

Origin must be Signed.

Ensures that ApprovalDeposit worth of Currency is reserved from signing account for the purpose of holding the approval. If some non-zero amount of assets is already approved from signing account to delegate, then it is topped up or unreserved to meet the right value.

NOTE: The signing account does not need to own amount of assets at the point of making this call.

  • id: The identifier of the asset.
  • delegate: The account to delegate permission to transfer asset.
  • amount: The amount of asset that may be transferred by delegate. If there is already an approval in place, then this acts additively.

Emits ApprovedTransfer on success.

Weight: O(1)

source

pub fn cancel_approval( origin: OriginFor<T>, id: T::AssetIdParameter, delegate: <<T as Config>::Lookup as StaticLookup>::Source ) -> DispatchResult

Cancel all of some asset approved for delegated transfer by a third-party account.

Origin must be Signed and there must be an approval in place between signer and delegate.

Unreserves any deposit previously reserved by approve_transfer for the approval.

  • id: The identifier of the asset.
  • delegate: The account delegated permission to transfer asset.

Emits ApprovalCancelled on success.

Weight: O(1)

source

pub fn force_cancel_approval( origin: OriginFor<T>, id: T::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source, delegate: <<T as Config>::Lookup as StaticLookup>::Source ) -> DispatchResult

Cancel all of some asset approved for delegated transfer by a third-party account.

Origin must be either ForceOrigin or Signed origin with the signer being the Admin account of the asset id.

Unreserves any deposit previously reserved by approve_transfer for the approval.

  • id: The identifier of the asset.
  • delegate: The account delegated permission to transfer asset.

Emits ApprovalCancelled on success.

Weight: O(1)

source

pub fn transfer_approved( origin: OriginFor<T>, id: T::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source, destination: <<T as Config>::Lookup as StaticLookup>::Source, amount: T::Balance ) -> DispatchResult

Transfer some asset balance from a previously delegated account to some third-party account.

Origin must be Signed and there must be an approval in place by the owner to the signer.

If the entire amount approved for transfer is transferred, then any deposit previously reserved by approve_transfer is unreserved.

  • id: The identifier of the asset.
  • owner: The account which previously approved for a transfer of at least amount and from which the asset balance will be withdrawn.
  • destination: The account to which the asset balance of amount will be transferred.
  • amount: The amount of assets to transfer.

Emits TransferredApproved on success.

Weight: O(1)

source

pub fn touch(origin: OriginFor<T>, id: T::AssetIdParameter) -> DispatchResult

Create an asset account for non-provider assets.

A deposit will be taken from the signer account.

  • origin: Must be Signed; the signer account must have sufficient funds for a deposit to be taken.
  • id: The identifier of the asset for the account to be created.

Emits Touched event when successful.

source

pub fn refund( origin: OriginFor<T>, id: T::AssetIdParameter, allow_burn: bool ) -> DispatchResult

Return the deposit (if any) of an asset account.

The origin must be Signed.

  • id: The identifier of the asset for the account to be created.
  • allow_burn: If true then assets may be destroyed in order to complete the refund.

Emits Refunded event when successful.

source

pub fn reserve( origin: OriginFor<T>, id: T::ReserveIdentifier, asset_id: T::AssetId, who: <<T as Config>::Lookup as StaticLookup>::Source, amount: T::Balance ) -> DispatchResult

Reserve some assets on an account for a specific asset.

Origin must be Signed and the sender should be the Admin of the asset id.

  • id: The identifier to be used for the reserve
  • asset_id: The identifier of the asset.
  • who: The account on which the assets are to be reserved.
  • amount: The amount to reserve who’s free balance is decreased by amount and the reserve balance increased by amount. The reserve balance of the asset with asset_id is increased by amount. A named reserve with id is added to reserves.

Emits Reserved with the reserved amount.

Weight: O(1)

source

pub fn unreserve( origin: OriginFor<T>, id: T::ReserveIdentifier, asset_id: T::AssetId, who: <<T as Config>::Lookup as StaticLookup>::Source ) -> DispatchResult

Unreserve assets reserved under id from an account

Origin must be Signed and the sender should be the Admin of the asset id.

  • id: The identifier to be used for the reserve
  • asset_id: The identifier of the asset.
  • who: The account on which the assets are to be unreserved. who’s free balance is increased by amount and the reserve balance decreased by amount. The reserve balance of the asset with asset_id is decreased by amount. The named reserve with id is removed.

Emits Uneserved with the reserved amount.

Weight: O(1)

source

pub fn burn_reserve( origin: OriginFor<T>, id: T::ReserveIdentifier, asset_id: T::AssetId, who: <<T as Config>::Lookup as StaticLookup>::Source ) -> DispatchResult

Burn assets reserved under id from an account

Origin must be Signed and the sender should be the Admin of the asset id.

  • id: The identifier to be used for the reserve
  • asset_id: The identifier of the asset.
  • who: The account on which the reserved assets are to be burned. who’s reserve balance is decreased by amount. The reserve balance of the asset with asset_id is decreased by amount and the supply is decreased by amount. The named reserve with id is removed.

Emits BurnedReserve with the reserved amount.

Weight: O(1)

source§

impl<T: Config<I>, I: 'static> Pallet<T, I>

source

pub fn reserves<KArg1, KArg2>( k1: KArg1, k2: KArg2 ) -> BoundedVec<ReserveData<T::ReserveIdentifier, T::Balance>, T::MaxReserves>where KArg1: EncodeLike<T::AssetId>, KArg2: EncodeLike<T::AccountId>,

Named reserves on account balances for a specific asset.

Trait Implementations§

source§

impl<T: Config<I>, I: 'static> Callable<T> for Pallet<T, I>

§

type RuntimeCall = Call<T, I>

source§

impl<T, I> Clone for Pallet<T, I>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Config<I>, I: 'static> Create<<T as Config>::AccountId> for Pallet<T, I>

source§

fn create( id: T::AssetId, admin: T::AccountId, is_sufficient: bool, min_balance: Self::Balance ) -> DispatchResult

Create a new fungible asset.
source§

impl<T, I> Debug for Pallet<T, I>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Config<I>, I: 'static> Destroy<<T as Config>::AccountId> for Pallet<T, I>

source§

fn start_destroy( id: T::AssetId, maybe_check_owner: Option<T::AccountId> ) -> DispatchResult

Start the destruction an existing fungible asset. Read more
source§

fn destroy_accounts( id: T::AssetId, max_items: u32 ) -> Result<u32, DispatchError>

Destroy all accounts associated with a given asset. destroy_accounts should only be called after start_destroy has been called, and the asset is in a Destroying state Read more
source§

fn destroy_approvals( id: T::AssetId, max_items: u32 ) -> Result<u32, DispatchError>

Destroy all approvals associated with a given asset up to the max_items destroy_approvals should only be called after start_destroy has been called, and the asset is in a Destroying state Read more
source§

fn finish_destroy(id: T::AssetId) -> DispatchResult

Complete destroying asset and unreserve currency. finish_destroy should only be called after start_destroy has been called, and the asset is in a Destroying state. All accounts or approvals should be destroyed before hand. Read more
source§

impl<T: Config<I>, I: 'static> GetStorageVersion for Pallet<T, I>

source§

fn current_storage_version() -> StorageVersion

Returns the current storage version as supported by the pallet.
source§

fn on_chain_storage_version() -> StorageVersion

Returns the on-chain storage version of the pallet as stored in the storage.
source§

impl<T: Config<I>, I: 'static> Hooks<<T as Config>::BlockNumber> for Pallet<T, I>

§

fn on_finalize(_n: BlockNumber)

The block is being finalized. Implement to have something happen.
§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

This will be run when the block is being finalized (before on_finalize). Implement to have something happen using the remaining weight. Will not fire if the remaining weight is 0. Return the weight used, the hook will subtract it from current weight used and pass the result to the next on_idle hook if it exists.
§

fn on_initialize(_n: BlockNumber) -> Weight

The block is being initialized. Implement to have something happen. Read more
§

fn on_runtime_upgrade() -> Weight

Perform a module upgrade. Read more
§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a module allows you to perform long-running tasks that make (by default) validators generate transactions that feed results of those long-running computations back on chain. Read more
§

fn integrity_test()

Run integrity test. Read more
source§

impl<T: Config<I>, I: 'static> Inspect<<T as Config>::AccountId> for Pallet<T, I>

source§

fn name(asset: T::AssetId) -> Vec<u8>

source§

fn symbol(asset: T::AssetId) -> Vec<u8>

source§

fn decimals(asset: T::AssetId) -> u8

source§

impl<T: Config<I>, I: 'static> Inspect<<T as Config>::AccountId> for Pallet<T, I>

§

type AssetId = <T as Config<I>>::AssetId

Means of identifying one asset class from another.
§

type Balance = <T as Config<I>>::Balance

Scalar type for representing balance of an account.
source§

fn total_issuance(asset: Self::AssetId) -> Self::Balance

The total amount of issuance in the system.
source§

fn minimum_balance(asset: Self::AssetId) -> Self::Balance

The minimum balance any single account may have.
source§

fn balance( asset: Self::AssetId, who: &<T as SystemConfig>::AccountId ) -> Self::Balance

Get the asset balance of who.
source§

fn reducible_balance( asset: Self::AssetId, who: &<T as SystemConfig>::AccountId, keep_alive: bool ) -> Self::Balance

Get the maximum amount of asset that who can withdraw/transfer successfully.
source§

fn can_deposit( asset: Self::AssetId, who: &<T as SystemConfig>::AccountId, amount: Self::Balance, mint: bool ) -> DepositConsequence

Returns true if the asset balance of who may be increased by amount. Read more
source§

fn can_withdraw( asset: Self::AssetId, who: &<T as SystemConfig>::AccountId, amount: Self::Balance ) -> WithdrawConsequence<Self::Balance>

Returns Failed if the asset balance of who may not be decreased by amount, otherwise the consequence.
source§

fn asset_exists(asset: Self::AssetId) -> bool

Returns true if an asset exists.
§

fn active_issuance(asset: Self::AssetId) -> Self::Balance

The total amount of issuance in the system excluding those which are controlled by the system.
source§

impl<T: Config<I>, I: 'static> Inspect<<T as Config>::AccountId> for Pallet<T, I>

source§

fn allowance( asset: T::AssetId, owner: &<T as SystemConfig>::AccountId, delegate: &<T as SystemConfig>::AccountId ) -> T::Balance

source§

impl<T: Config<I>, I: 'static> Inspect<<T as Config>::AccountId> for Pallet<T, I>

source§

fn owner(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId>

source§

fn issuer(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId>

source§

fn admin(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId>

source§

fn freezer(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId>

source§

impl<T: Config<I>, I: 'static> InspectEnumerable<<T as Config>::AccountId> for Pallet<T, I>

source§

fn asset_ids() -> Self::AssetsIterator

Returns an iterator of the assets in existence.

NOTE: iterating this list invokes a storage read per item.

§

type AssetsIterator = KeyPrefixIterator<<T as Config<I>>::AssetId>

source§

impl<T: Config<I>, I: 'static> InspectMetadata<<T as Config>::AccountId> for Pallet<T, I>

source§

fn name(asset: &Self::AssetId) -> Vec<u8>

Return the name of an asset.

source§

fn symbol(asset: &Self::AssetId) -> Vec<u8>

Return the symbol of an asset.

source§

fn decimals(asset: &Self::AssetId) -> u8

Return the decimals of an asset.

source§

impl<T: Config<I>, I: 'static> IntegrityTest for Pallet<T, I>

source§

fn integrity_test()

Run integrity test. Read more
source§

impl<T: Config<I>, I: 'static> Mutate<<T as Config>::AccountId> for Pallet<T, I>

source§

fn approve( asset: T::AssetId, owner: &<T as SystemConfig>::AccountId, delegate: &<T as SystemConfig>::AccountId, amount: T::Balance ) -> DispatchResult

source§

fn transfer_from( asset: T::AssetId, owner: &<T as SystemConfig>::AccountId, delegate: &<T as SystemConfig>::AccountId, dest: &<T as SystemConfig>::AccountId, amount: T::Balance ) -> DispatchResult

source§

impl<T: Config<I>, I: 'static> Mutate<<T as Config>::AccountId> for Pallet<T, I>

source§

fn mint_into( asset: Self::AssetId, who: &<T as SystemConfig>::AccountId, amount: Self::Balance ) -> DispatchResult

Attempt to increase the asset balance of who by amount. Read more
source§

fn burn_from( asset: Self::AssetId, who: &<T as SystemConfig>::AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Attempt to reduce the asset balance of who by amount. Read more
source§

fn slash( asset: Self::AssetId, who: &<T as SystemConfig>::AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Attempt to reduce the asset balance of who by as much as possible up to amount, and possibly slightly more due to minimum_balance requirements. If no decrease is possible then an Err is returned and nothing is changed. If successful, the amount of tokens reduced is returned. Read more
§

fn teleport( asset: Self::AssetId, source: &AccountId, dest: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Transfer funds from one account into another. The default implementation uses mint_into and burn_from and may generate unwanted events.
source§

impl<T: Config<I>, I: 'static> Mutate<<T as Config>::AccountId> for Pallet<T, I>

source§

fn set( asset: T::AssetId, from: &<T as SystemConfig>::AccountId, name: Vec<u8>, symbol: Vec<u8>, decimals: u8 ) -> DispatchResult

source§

impl<T: Config<I>, I: 'static> OffchainWorker<<T as Config>::BlockNumber> for Pallet<T, I>

source§

fn offchain_worker(n: <T as Config>::BlockNumber)

This function is being called after every block import (when fully synced). Read more
source§

impl<T: Config<I>, I: 'static> OnFinalize<<T as Config>::BlockNumber> for Pallet<T, I>

source§

fn on_finalize(n: <T as Config>::BlockNumber)

The block is being finalized. Implement to have something happen. Read more
source§

impl<T: Config<I>, I: 'static> OnGenesis for Pallet<T, I>

source§

fn on_genesis()

Something that should happen at genesis.
source§

impl<T: Config<I>, I: 'static> OnIdle<<T as Config>::BlockNumber> for Pallet<T, I>

source§

fn on_idle(n: <T as Config>::BlockNumber, remaining_weight: Weight) -> Weight

The block is being finalized. Implement to have something happen in case there is leftover weight. Check the passed remaining_weight to make sure it is high enough to allow for your pallet’s extra computation. Read more
source§

impl<T: Config<I>, I: 'static> OnInitialize<<T as Config>::BlockNumber> for Pallet<T, I>

source§

fn on_initialize(n: <T as Config>::BlockNumber) -> Weight

The block is being initialized. Implement to have something happen. Read more
source§

impl<T: Config<I>, I: 'static> OnRuntimeUpgrade for Pallet<T, I>

source§

fn on_runtime_upgrade() -> Weight

Perform a module upgrade. Read more
source§

impl<T: Config<I>, I: 'static> PalletInfoAccess for Pallet<T, I>

source§

fn index() -> usize

Index of the pallet as configured in the runtime.
source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
source§

impl<T: Config<I>, I: 'static> PalletsInfoAccess for Pallet<T, I>

source§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
source§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
source§

impl<T, I> PartialEq<Pallet<T, I>> for Pallet<T, I>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Config<I>, I: 'static> StorageInfoTrait for Pallet<T, I>

source§

fn storage_info() -> Vec<StorageInfo>

source§

impl<T: Config<I>, I: 'static> StoredMap<(<T as Config<I>>::AssetId, <T as Config>::AccountId), <T as Config<I>>::Extra> for Pallet<T, I>

source§

fn get(id_who: &(T::AssetId, T::AccountId)) -> T::Extra

Get the item, or its default if it doesn’t yet exist; we make no distinction between the two.
source§

fn try_mutate_exists<R, E: From<DispatchError>>( id_who: &(T::AssetId, T::AccountId), f: impl FnOnce(&mut Option<T::Extra>) -> Result<R, E> ) -> Result<R, E>

Maybe mutate the item only if an Ok value is returned from f. Do nothing if an Err is returned. It is removed or reset to default value if it has been mutated to None. f will always be called with an option representing if the storage item exists (Some<V>) or if the storage item does not exist (None), independent of the QueryType.
§

fn mutate<R>(k: &K, f: impl FnOnce(&mut T) -> R) -> Result<R, DispatchError>

Mutate the item.
§

fn mutate_exists<R>( k: &K, f: impl FnOnce(&mut Option<T>) -> R ) -> Result<R, DispatchError>

Mutate the item, removing or resetting to default value if it has been mutated to None. Read more
§

fn insert(k: &K, t: T) -> Result<(), DispatchError>

Set the item to something new.
§

fn remove(k: &K) -> Result<(), DispatchError>

Remove the item or otherwise replace it with its default value; we don’t care which.
source§

impl<T: Config<I>, I: 'static> Transfer<<T as Config>::AccountId> for Pallet<T, I>

source§

fn transfer( asset: Self::AssetId, source: &T::AccountId, dest: &T::AccountId, amount: T::Balance, keep_alive: bool ) -> Result<T::Balance, DispatchError>

Transfer funds from one account into another.
§

fn deactivate(_: Self::AssetId, _: Self::Balance)

Reduce the active issuance by some amount.
§

fn reactivate(_: Self::AssetId, _: Self::Balance)

Increase the active issuance by some amount, up to the outstanding amount reduced.
source§

impl<T: Config<I>, I: 'static> Unbalanced<<T as Config>::AccountId> for Pallet<T, I>

source§

fn set_balance( _: Self::AssetId, _: &T::AccountId, _: Self::Balance ) -> DispatchResult

Set the asset balance of who to amount. If this cannot be done for some reason (e.g. because the account cannot be created or an overflow) then an Err is returned.
source§

fn set_total_issuance(id: T::AssetId, amount: Self::Balance)

Set the total issuance of asset to amount.
source§

fn decrease_balance( asset: T::AssetId, who: &T::AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Reduce the asset balance of who by amount. If it cannot be reduced by that amount for some reason, return Err and don’t reduce it at all. If Ok, return the imbalance. Read more
source§

fn decrease_balance_at_most( asset: T::AssetId, who: &T::AccountId, amount: Self::Balance ) -> Self::Balance

Reduce the asset balance of who by the most that is possible, up to amount. Read more
source§

fn increase_balance( asset: T::AssetId, who: &T::AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Increase the asset balance of who by amount. If it cannot be increased by that amount for some reason, return Err and don’t increase it at all. If Ok, return the imbalance. Read more
source§

fn increase_balance_at_most( asset: T::AssetId, who: &T::AccountId, amount: Self::Balance ) -> Self::Balance

Increase the asset balance of who by the most that is possible, up to amount. Read more
source§

impl<T: Config<I>, I: 'static> WhitelistedStorageKeys for Pallet<T, I>

source§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a Vec<TrackedStorageKey> indicating the storage keys that should be whitelisted during benchmarking. This means that those keys will be excluded from the benchmarking performance calculation.
source§

impl<T, I> Eq for Pallet<T, I>

Auto Trait Implementations§

§

impl<T, I> RefUnwindSafe for Pallet<T, I>where I: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, I> Send for Pallet<T, I>where I: Send, T: Send,

§

impl<T, I> Sync for Pallet<T, I>where I: Sync, T: Sync,

§

impl<T, I> Unpin for Pallet<T, I>where I: Unpin, T: Unpin,

§

impl<T, I> UnwindSafe for Pallet<T, I>where I: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<AccountId, U> Balanced<AccountId> for Uwhere U: Unbalanced<AccountId>,

§

type OnDropCredit = DecreaseIssuance<AccountId, U>

The type for managing what happens when an instance of Credit is dropped without being used.
§

type OnDropDebt = IncreaseIssuance<AccountId, U>

The type for managing what happens when an instance of Debt is dropped without being used.
§

fn rescind( asset: <U as Inspect<AccountId>>::AssetId, amount: <U as Inspect<AccountId>>::Balance ) -> Imbalance<<U as Inspect<AccountId>>::AssetId, <U as Inspect<AccountId>>::Balance, IncreaseIssuance<AccountId, U>, DecreaseIssuance<AccountId, U>>

Reduce the total issuance by amount and return the according imbalance. The imbalance will typically be used to reduce an account by the same amount with e.g. settle. Read more
§

fn issue( asset: <U as Inspect<AccountId>>::AssetId, amount: <U as Inspect<AccountId>>::Balance ) -> Imbalance<<U as Inspect<AccountId>>::AssetId, <U as Inspect<AccountId>>::Balance, DecreaseIssuance<AccountId, U>, IncreaseIssuance<AccountId, U>>

Increase the total issuance by amount and return the according imbalance. The imbalance will typically be used to increase an account by the same amount with e.g. resolve_into_existing or resolve_creating. Read more
§

fn slash( asset: <U as Inspect<AccountId>>::AssetId, who: &AccountId, amount: <U as Inspect<AccountId>>::Balance ) -> (Imbalance<<U as Inspect<AccountId>>::AssetId, <U as Inspect<AccountId>>::Balance, DecreaseIssuance<AccountId, U>, IncreaseIssuance<AccountId, U>>, <U as Inspect<AccountId>>::Balance)

Deducts up to value from the combined balance of who, preferring to deduct from the free balance. This function cannot fail. Read more
§

fn deposit( asset: <U as Inspect<AccountId>>::AssetId, who: &AccountId, amount: <U as Inspect<AccountId>>::Balance ) -> Result<Imbalance<<U as Inspect<AccountId>>::AssetId, <U as Inspect<AccountId>>::Balance, IncreaseIssuance<AccountId, U>, DecreaseIssuance<AccountId, U>>, DispatchError>

Mints exactly value into the asset account of who. Read more
§

fn withdraw( asset: <U as Inspect<AccountId>>::AssetId, who: &AccountId, amount: <U as Inspect<AccountId>>::Balance ) -> Result<Imbalance<<U as Inspect<AccountId>>::AssetId, <U as Inspect<AccountId>>::Balance, DecreaseIssuance<AccountId, U>, IncreaseIssuance<AccountId, U>>, DispatchError>

Removes value free asset balance from who account if possible. Read more
§

fn pair( asset: Self::AssetId, amount: Self::Balance ) -> (Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>)

Produce a pair of imbalances that cancel each other out exactly. Read more
§

fn resolve( who: &AccountId, credit: Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt> ) -> Result<(), Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>>

The balance of who is increased in order to counter credit. If the whole of credit cannot be countered, then nothing is changed and the original credit is returned in an Err. Read more
§

fn settle( who: &AccountId, debt: Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit> ) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>>

The balance of who is decreased in order to counter debt. If the whole of debt cannot be countered, then nothing is changed and the original debt is returned in an Err.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CheckedConversion for T

§

fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
§

fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IsType<T> for T

§

fn from_ref(t: &T) -> &T

Cast reference.
§

fn into_ref(&self) -> &T

Cast reference.
§

fn from_mut(t: &mut T) -> &mut T

Cast mutable reference.
§

fn into_mut(&mut self) -> &mut T

Cast mutable reference.
§

impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

§

impl<T> PalletVersionToStorageVersionHelper for Twhere T: GetStorageVersion + PalletInfoAccess,

§

fn migrate(db_weight: &RuntimeDbWeight) -> Weight

§

impl<T> Pipe for Twhere T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> Rwhere Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> SaturatedConversion for T

§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,

§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> MaybeDebug for Twhere T: Debug,

§

impl<T> MaybeDebug for Twhere T: Debug,

§

impl<T> MaybeRefUnwindSafe for Twhere T: RefUnwindSafe,

§

impl<T> Member for Twhere T: Send + Sync + Debug + Eq + PartialEq<T> + Clone + 'static,